This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes Hibernate Reverse & codegen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Reverse & codegen" Watch "Hibernate Reverse & codegen" New topic

Hibernate Reverse & codegen

Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 230

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:

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

<hibernatetool destdir="${build.classes.dir}">
<jdbcconfiguration configurationfile="../configuration/Hibernate/hibernate.cfg.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}"/>
<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}"/>



Any ideas???

SCJP 5.0, SCJD URLyBird 1.3.3, OCMJEA 5 (SCEA) Factory Homes
jason none

Joined: Apr 24, 2006
Posts: 2
ever find a solution to this? thanks!!
I agree. Here's the link:
subject: Hibernate Reverse & codegen