-->
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: jdk5 and ejb3 options unavailable in HibernateTools-3.2.4.GA
PostPosted: Mon Jul 06, 2009 3:45 pm 
Newbie

Joined: Sun Jul 05, 2009 9:59 pm
Posts: 6
Hi,
I am using Hibernate ant tools to reverse engineer classes. However, the jdk5 and ejb3 options are not available to me with the exporters. Please advise.

hibernate-distribution-3.3.2.GA
hibernate-annotations-3.4.0.GA
hibernate-entitymanager-3.4.0.GA
HibernateTools-3.2.4.GA
hsqldb-1.8.0.10
Eclipse 3.4.2 Ganymede
Classpath: build;lib\antlr-2.7.6.jar;lib\asm.jar;lib\c3p0-0.9.1.jar;lib\cglib-2.1.3.jar;lib\commons-collections-3.1.jar;lib\commons-logging.jar;lib\dom4j-1.6.1.jar;lib\ejb3-persistence.jar;lib\freemarker.jar;lib\hibernate-annotations.jar;lib\hibernate-commons-annotations.jar;lib\hibernate-entitymanager.jar;lib\hibernate-tools.jar;lib\hibernate3.jar;lib\hsqldb.jar;lib\javassist-3.9.0.GA.jar;lib\jta-1.1.jar;lib\jtidy-r8-20060801.jar;lib\log4j.jar;lib\servlet-api.jar;lib\slf4j-api-1.5.8.jar;lib\slf4j-jdk14-1.5.8.jar; (and a lot Eclipse jars)

Build script snippet:

Code:
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.classpath" />
   <target name="schemaexport" depends="compile, copymetafiles" description="Export a generated schema to DB and file">
      <hibernatetool destdir="${db.dir}">
         <classpath path="${build.dir}" />
         <configuration configurationfile="${build.dir}/hibernate.cfg.xml" />
         <hbm2ddl drop="true" create="true" export="true" outputfilename="helloworld-ddl.sql" delimiter=";" format="true" />
      </hibernatetool>
   </target>

   <target name="reveng.hbmxml" description="Produce XML mapping files in src directory">
      <hibernatetool destdir="${src.java.dir}">
         <jdbcconfiguration propertyfile="${db.dir}/library.db.properties" revengfile="${db.dir}/library.reveng.xml" />
         <!-- Export Hibernate XML files -->
         <hbm2hbmxml />
         <!-- Export a hibernate.cfg.xml file -->
         <hbm2cfgxml />
      </hibernatetool>
   </target>

   <target name="reveng.pojos" depends="reveng.hbmxml" description="Produce Java classes from XML mappings">
      <hibernatetool destdir="${src.java.dir}">
         <configuration>
            <fileset dir="${src.java.dir}">
               <include name="**/*.hbm.xml" />
            </fileset>
         </configuration>
         <hbm2java />
         <!-- Generate entity class source -->
      </hibernatetool>
   </target>


Top
 Profile  
 
 Post subject: Re: jdk5 and ejb3 options unavailable in HibernateTools-3.2.4.GA
PostPosted: Mon Jul 06, 2009 3:57 pm 
Newbie

Joined: Sun Jul 05, 2009 9:59 pm
Posts: 6
OK, I have found the solution. The following ant task works for me:
Code:
<target name="reveng.entities" description="Produce Java entity classes in src directory">
  <hibernatetool destdir="${src.java.dir}">
    <jdbcconfiguration propertyfile="${db.dir}/library.db.properties" revengfile="${db.dir}/library.reveng.xml" />
    <hbm2java jdk5="true" ejb3="true" />
    <hbm2cfgxml ejb3="true" />
  </hibernatetool>
</target>


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.