-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Using mapping file for hbm2java
PostPosted: Fri Dec 12, 2008 6:20 am 
Newbie

Joined: Fri Dec 12, 2008 3:34 am
Posts: 3
Hi, i'm using Ant to generate my classes from a database.
Only, i want to rename the classes generated, so i thought that i could base the generation on a mapping file that i created.
but it doesn't work :(

i tried
<hibernatetool>
<jdbcconfiguration propertyfile="hibernate.properties">
<fileset dir="${basedir}/config">
<include name="Testtable.hbm.xml" />
</fileset>
</jdbcconfiguration>
<hbm2java jdk5="true" destdir="${basedir}/src" />
</hibernatetool>
but i got an error because it doesn't find the classes (obviously because i want to generate them)

i look in reverse engineering but i have not found the balise to rename class

If someone knows

Thanks


Top
 Profile  
 
 Post subject: Similar problem
PostPosted: Fri Dec 12, 2008 11:46 am 
Newbie

Joined: Mon Dec 08, 2008 5:51 pm
Posts: 8
I worked around this in two steps.
First I used a hibernate.reveng.xml file to generate the *.hbm.xml files (and java classes) the first time through - once generated I set the table filter for those classes to false. <table-filter match-name="<name>" exclude="true"/>

Next I redefined the build target for the hbm2java portion as follows:

<target name="custompojo">
<hibernatetool destdir="${builddir}">
<configuration>
<fileset dir="${builddir}">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2java jdk5="false"/>
</hibernatetool>
</target>

Let me know if this helps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.