-->
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.  [ 4 posts ] 
Author Message
 Post subject: hibernate hbm2java
PostPosted: Mon Sep 26, 2005 9:32 pm 
Newbie

Joined: Mon Sep 26, 2005 9:10 pm
Posts: 4
I am using the following build script for hibernate tool....
===============
<hibernatetool destdir="${output.dir}">
<jdbcconfiguration configurationfile="${config.dir}/hibernate.cfg.xml"/>
<cfg2hbm/>
<hbm2java />
<cfg2cfgxml />
<hbm2doc destdir="${output.dir}/docs" />
</hibernatetool>
===============================
It works fine.. I want to break it up into 2 steps .


Step 1 Generate hbm files ... I am able to do this with "<cfg2hbm/>" and removing other entries..
===============Step 1 ===========
<hibernatetool destdir="${output.dir}">
<jdbcconfiguration configurationfile="${config.dir}/hibernate.cfg.xml" />
<cfg2hbm/>
<hbm2doc destdir="${output.dir}/docs" />
</hibernatetool>
===============================


Step 2.. I want to edit the hbm files and generate java code from it .. I am not able to do ... even I remove the "cfg2hbm" it still reads DB and ignores my changes..
===============Step 2=========
<hibernatetool destdir="${output.dir}">
<jdbcconfiguration configurationfile="${config.dir}/hibernate.cfg.xml" />
<hbm2java />
<cfg2cfgxml />
<hbm2doc destdir="${output.dir}/docs" />
</hibernatetool>
===============================

I want to use the hibernatool just to generate java files without reading the DB.Can some body help please?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 9:36 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
it's going to the database because you are using the jdbcconfiguration element . You need a plain configuration element w/ a nested fileset element. Read the tools documentation for ant tasks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 10:09 pm 
Newbie

Joined: Mon Sep 26, 2005 9:10 pm
Posts: 4
dennisbyrne wrote:
it's going to the database because you are using the jdbcconfiguration element . You need a plain configuration element w/ a nested fileset element. Read the tools documentation for ant tasks.


Thank you .. got to work...


When I am running cfg2hbm ... I get this "unsaved-value="$c2h.getUnsavedValue($property)" in the hbm file... I have to remove this manually..to run hbm2java task...

Any clue how to get rid of this..

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 11:47 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
devinenik wrote:

When I am running cfg2hbm ... I get this "unsaved-value="$c2h.getUnsavedValue($property)"


I have a bug for this already. http://opensource2.atlassian.com/projects/hibernate/browse/HBX-406

Please read through it and take a look at the part where the class name is ending up in the generator element. Are you getting this also by any chance?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.