-->
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.  [ 5 posts ] 
Author Message
 Post subject: Running the CodeGen with a Dir of .hbm files
PostPosted: Sat Apr 24, 2004 8:58 pm 
Beginner
Beginner

Joined: Fri Apr 02, 2004 3:34 am
Posts: 40
Hi,

The below is from the doc:

java -cp hibernate_classpaths net.sf.hibernate.tool.hbm2java.CodeGenerator options mapping_files

"mapping_files", how do I specify a directory that contains mapping files? I would like each files to be processed.

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 12:17 am 
Beginner
Beginner

Joined: Fri Apr 02, 2004 3:34 am
Posts: 40
Clarification: I would like to run hbm2java from within ANT with the following config:

<codegen>
<!-- <generate prefix="Base" renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/> -->
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer">
<param name="generate-empty-concrete-classes">true</param>
<param name="baseclass-prefix">Base</param>
</generate>
</codegen>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 12:24 am 
Beginner
Beginner

Joined: Fri Apr 02, 2004 3:34 am
Posts: 40
Googling around I found one could specify the attribute below for the hbm2java ant task..

config="${build.dir}/hibernate.cfg.xml

Acco Lade wrote:
Clarification: I would like to run hbm2java from within ANT with the following config:

<codegen>
<!-- <generate prefix="Base" renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/> -->
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer">
<param name="generate-empty-concrete-classes">true</param>
<param name="baseclass-prefix">Base</param>
</generate>
</codegen>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 6:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
NO! config is for hbm2java's config.xml not hibernates cfg.xml!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 1:03 pm 
Beginner
Beginner

Joined: Fri Apr 02, 2004 3:34 am
Posts: 40
Yeah, not sure why that example used hibernatet.cfg.xml, but used "codegen.xml" and it worked well..


max wrote:
NO! config is for hbm2java's config.xml not hibernates cfg.xml!


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