-->
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: hbm2hbmxml not generating mapping files
PostPosted: Mon Jun 11, 2007 5:39 pm 
Newbie

Joined: Mon Jun 11, 2007 5:30 pm
Posts: 1
I am not able to generate hbm files using hbm2hbmxml task. Please help.

Here are the files/versions that i am using
Hibernate - hibernate3.jar
Hibernate Tools - hibernate-tools.jar
MySQL DB - 4.0.18

Build.xml
----------

<project name="Test" default="compile" basedir=".">
<property name="lib.dir" value="lib"/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>

<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>

<target name="clean" description="Clean the build directory">
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
</target>

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.classpath" />

<target name="reveng">
<hibernatetool destdir="${basedir}/src">
<jdbcconfiguration propertyfile="${basedir}/test.db.properties"/>
<hbm2hbmxml/>
<hbm2cfgxml/>
</hibernatetool>
</target>

<target name="genjava">
<hibernatetool destdir="${basedir}/src">
<configuration>
<fileset dir="${basedir}/src">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2java/>

</hibernatetool>
</target>


</project>

test.db.properties
--------------------

hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/testdb
hibernate.connection.username=****

I am not using a reveng.xml since its optional.

When i run the build file, this is the output that i get, only hibernate.cfg.xml file gets generated which has database configuration. No hbm files are generated.

Build output
--------------
Buildfile: build.xml

reveng:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 2. task: cfg2cfgxml (Generates hibernate.cfg.xml)


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.