-->
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.  [ 3 posts ] 
Author Message
 Post subject: hbm2hbmxml generate no files
PostPosted: Thu Jul 12, 2007 4:01 am 
Newbie

Joined: Thu Jun 28, 2007 1:46 pm
Posts: 7
Hi, I use Hibernate Tool 3.2.0beta9a with Ant Task to generate mapping file from the Database schema. Ant task ran succesfully but no files was generated. Could anyboby please help me?

buildfile:
Code:
<project name="ReverseDB" default="jar" basedir=".">
   <taskdef name="hibernatetool"
               classname="org.hibernate.tool.ant.HibernateToolTask">
                <classpath>
               <fileset dir="lib">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
   </taskdef>   
   
   <target name="jar" description="Build the distribution .jar file">      
      <property name="PojoFolder" value="C:\Documents and Settings\Admin\rssreader\src\src\com\vht\pojo" />
      <hibernatetool destdir="${PojoFolder}">
         <configuration configurationfile="C:\Documents and Settings\Admin\rssreader\src\hibernate.cfg.xml"/>
         
         <hbm2java destdir="${PojoFolder}"/>
       </hibernatetool>   
    </target>
</project>


Config file:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
   <!-- Database connection settings -->
   <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
   <property name="connection.url">jdbc:mysql://localhost/joomla</property>
   <property name="connection.username">root</property>
   <property name="connection.password">genius</property>

   <!-- JDBC connection pool (use the built-in) -->
   <property name="connection.pool_size">1</property>

   <!-- SQL dialect -->
   <property name="dialect">org.hibernate.dialect.MysqlDialect</property>

   <!-- Enable Hibernate's automatic session context management -->
   <property name="current_session_context_class">thread</property>

   <!-- Disable the second-level cache  -->
   <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

   <!-- Echo all executed SQL to stdout -->
   <property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>


And the Build file result:
Code:
Buildfile: C:\Documents and Settings\Admin\rssreader\src\reverse.engineer.xml
jar:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] Jul 12, 2007 2:48:14 PM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.2.4.sp1
[hibernatetool] Jul 12, 2007 2:48:14 PM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] Jul 12, 2007 2:48:14 PM org.hibernate.cfg.Environment buildBytecodeProvider
[hibernatetool] INFO: Bytecode provider name : cglib
[hibernatetool] Jul 12, 2007 2:48:14 PM org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] Jul 12, 2007 2:48:15 PM org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] Jul 12, 2007 2:48:15 PM org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] Jul 12, 2007 2:48:15 PM org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.0.b9
BUILD SUCCESSFUL
Total time: 2 seconds


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 2:55 pm 
Newbie

Joined: Tue Jul 03, 2007 10:01 am
Posts: 2
If you are trying to reverse engineer from your database connection, you need to use the jdbcconfiguration element, not the base configuration element.

Code:
   <target name="jar" description="Build the distribution .jar file">     
      <property name="PojoFolder" value="C:\Documents and Settings\Admin\rssreader\src\src\com\vht\pojo" />
      <hibernatetool destdir="${PojoFolder}">
         <jdbcconfiguration configurationfile="C:\Documents and Settings\Admin\rssreader\src\hibernate.cfg.xml"/>
         
         <hbm2java destdir="${PojoFolder}"/>
       </hibernatetool>   
    </target>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 11:52 pm 
Newbie

Joined: Thu Jun 28, 2007 1:46 pm
Posts: 7
Thank you so much. I got it done!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.