• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Reverse & codegen

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Hibernate3, Hibernate-Tools Beta 4, SDK 1.4.2

I'm generating code from database. I'm overriding existing templates to generate my custom methods. Pojo code is generated properly, but daohome.vm-code gives error:

Error
------
D:\cvs\blah\www\bin\build.xml:199: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while processing t
emplate templates/dao/daohome.vm. Invocation of method 'getJavaTypeName' in class org.hibernate.tool.hbm2x.Cfg2JavaTool threw exc
eption class java.lang.NullPointerException : null



build.xml
---------
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpath="${lib.dir}/Hibernate/hibernate-tools.jar;
${lib.dir}/Hibernate/hibernate3.jar;
${lib.dir}/Hibernate/velocity-1.4.jar;
${lib.dir}/Hibernate/commons-logging-1.0.4.jar;
${lib.dir}/Hibernate/jtidy-r8-21122004.jar;
${lib.dir}/Hibernate/dom4j-1.6.1.jar;
${lib.dir}/ojdbc14-9205.jar;
${lib.dir}/Hibernate/ehcache-1.1.jar;
${lib.dir}/Hibernate/cglib-2.1.3.jar;
${lib.dir}/Hibernate/asm.jar;
${lib.dir}/Hibernate/commons-collections-2.1.1.jar;
${lib.dir}/Hibernate/velocity-tools-generic-1.1.jar"/>
<hibernatetool destdir="${build.classes.dir}">
<jdbcconfiguration configurationfile="../configuration/Hibernate/hibernate.cfg.xml"
revengfile="hibernate.reveng.xml"/>
<property key="jdk5" value="false"/>
<property key="ejb3" value="false"/>
<hbm2hbmxml destdir="../configuration/Hibernate"/>

<!--hbm2dao destdir="${src.dir}/com/blah/persistence/dataaccess/gen"/-->

<hbmtemplate destdir="${src.dir}/com/blah/persistence/dataaccess/gen" templateprefix="dao/" template="templates/dao/daohome.vm" filepattern="{package-name}/{class-name}Home.java"/>
<hbmtemplate destdir="${src.dir}/com/blah/persistence/dto" templateprefix="pojo/" template="templates/pojo/Pojo.vm" filepattern="{package-name}/{class-name}.java"/>
<hbmtemplate destdir="${src.dir}/com/blah/persistence/datainterface" templateprefix="pojo/" template="templates/pojo/PojoInterface.vm" filepattern="{package-name}/{class-name}I.java"/>

</hibernatetool>

---------

Any ideas???
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ever find a solution to this? thanks!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic