-->
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: Generating POJO's Through ANT
PostPosted: Mon Jul 21, 2008 1:54 am 
Newbie

Joined: Thu Jul 17, 2008 2:16 am
Posts: 11
Hi,
I am new to Hibernate and I am trying to genrate the POJO's with the help of ANT script. when I runs the build.xml it successful but it doesn't generate any class.

This is my build.xml plz help me

<project name="ch01" default="run" basedir=".">

<!-- Set up properties containing important project directories -->

<property name="source.root" value="src"/>

<property name="class.root" value="classes"/>

<property name="lib.dir" value="lib"/>

<property name="data.dir" value="data"/>



<!-- Set up the class path for compilation and execution -->

<path id="project.class.path">

<!-- Include our own classes, of course -->

<pathelement location="${class.root}" />

<!-- Include jars in the project library directory -->

<fileset dir="${lib.dir}">

<include name="*.jar"/>

</fileset>

</path>

<!-- Teach Ant how to use Hibernate's code generation tool -->

<taskdef name="hbm2java" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.class.path"/>

<!-- Generate the java code for all mapping files in our source tree -->

<target name="codegen" description="Generate Java source from the O/R mapping files">

<!--<hbm2java output="${source.root}">-->
<hbm2java destdir="${source.root}">

<configuration configurationfile="hibernate.cfg.xml"/>
<hbm2java jdk5="true"/>

</hbm2java>

</target>

</project>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 9:13 am 
Newbie

Joined: Sat Jul 12, 2008 4:25 am
Posts: 8
Hi,

Which version of hibernate are you using? With the latest release, your script should contain sth. like:
Code:
<hibernatetool destdir="${build.dir}/generated">

<configuration configurationfile="hibernate.cfg.xml"/>

<hbm2java jdk5="true"/>

</hibernatetool>


And perhaps there's sth missing in your hibernate.cfg.xml file? Please add it to your post, this will make it easier for us to help you.

Regards,
Matt


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.