-->
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.  [ 1 post ] 
Author Message
 Post subject: [Newbie]- Generating code using ant target 'codegen'
PostPosted: Wed Apr 20, 2005 11:14 pm 
Regular
Regular

Joined: Thu Aug 05, 2004 11:15 pm
Posts: 50
In hibernate 2.1 I used this in my build file to generate code:


<!-- Teach Ant how to use Hibernate's code generation tool -->
<taskdef name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref="project.class.path"/>


<!-- Generate the java code for all mapping files in our source tree -->
<target name="codegen" depends="prepare"
description="Generate Java source from the O/R mapping files">
<hbm2java output="${source.root}">
<fileset dir="${source.root}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>


The net.sf.hibernate.tool.hbm2java.Hbm2JavaTask comes from the hibernate2.jar file.


I want to convert my build file and code to Hibernate 3.0 . With Hibernate 3.0 there is now hibernate3.jar instead of hibernate2.jar. I can't seem to get the codegen working now, because the classpath name will be different now so it will not be: net.sf.hibernate.tool.hbm2java.Hbm2JavaTask. Can someone help me with this and tell me the classpath name or how they did 'codegen' in their build file? Any help appreciated.


Thank you,
John


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

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.