-->
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.  [ 6 posts ] 
Author Message
 Post subject: Newbie hbm2java question
PostPosted: Tue Sep 30, 2003 12:04 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
Please forgive me, this is probably a stupid/obvious question, but I have searched around for the last 2 days and am stuck...

I am rather new to Hibernate and Ant, and I have been trying to get hbm2java to work as an automated Ant process. I found this information here: http://www.hibernate.org/98.html about setting up hbm2java as an optional ant task. I added this to my hbm2java target in my build.xml:

<taskdef
name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.CodeGenerator"
classpathref="hbm.classpath"
/>

<hbm2java
output="${javaoutput.dir}"
>
<fileset dir="${mappingoutput.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>

However, I get this error:
BUILD FAILED
file:C:/java/Middlegen-Hibernate-r2/build.xml:308: No public execute() in class net.sf.hibernate.tool.hbm2java.CodeGenerator

I am pretty sure that is because I need to code up an Ant task for hbm2java. Is this included somewhere in the Hibernate-2.0.3 files or in the tools files, or do I need to write this myself? Also, where would I put that Hbm2javaTask class file?

Thanks so much,
-Kat


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 12:07 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/examples/

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 2:03 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
Great! My hibernate-tools.jar (downloaded from sourceforge) was not the right one... was missing the Hbm2JavaTask class. It works now.

Thanks so much!

-Kat


Btw, for anyone else who has this problem... make sure you get the hibernate-tools.jar from the examples on the site listed above, and this was the final version of my build.xml target:

<taskdef name="hbm2java" classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask">
<classpath refid="hbm.classpath" />
</taskdef>

<hbm2java
output="${javaoutput.dir}"
>
<fileset dir="${mappingoutput.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 2:37 pm 
Newbie

Joined: Fri Oct 10, 2003 2:06 pm
Posts: 1
Location: Uberlandia, MG, Brazil
I downloaded at SourceForge the most recent hibernate-extensions-2.0.zip that contains hibernate-tools.jar, but It doesn't have any Hbm2JavaTask!
Where else can I find it?
Would you mind if you send me by email this hibernate-tools.jar?
Thanks in advance.
<<<---------->>>>>>>>

Kat wrote:
Great! My hibernate-tools.jar (downloaded from sourceforge) was not the right one... was missing the Hbm2JavaTask class. It works now.

Thanks so much!

-Kat


Btw, for anyone else who has this problem... make sure you get the hibernate-tools.jar from the examples on the site listed above, and this was the final version of my build.xml target:

<taskdef name="hbm2java" classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask">
<classpath refid="hbm.classpath" />
</taskdef>

<hbm2java
output="${javaoutput.dir}"
>
<fileset dir="${mappingoutput.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 2:57 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Get the CVS snapshots: http://hibernate.sourceforge.net/snapshots/

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2003 2:57 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
You can also find that hibernate-tools.jar in the lib directory of the sample source code, here: http://www.hibernate.org/hib_docs/examp ... /java/lib/

-Kat


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