-->
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: Problem with code generation using Ant with eclipse
PostPosted: Tue Jun 12, 2007 10:43 am 
Newbie

Joined: Tue Jun 12, 2007 10:25 am
Posts: 3
Hello,

I want to generate Domain Code and DAO from a MYSQL database.
For this I use eclipse and I want to use specific configuration so I have created a build.xml file.

Here is my build.xml file :

Code:
<project name="TestAgain" basedir="." default="hibernateCodeGen">

  <path id="toolslib">
    <path location="lib/hibernate-tools.jar" />
    <path location="lib/hibernate3.jar" />
    <path location="lib/freemarker-2.3.8.jar" />
    <path location="lib/mysql-connector-java-5.0.6-bin.jar" />
    <path location="lib/commons-logging-1.0.4.jar" />
    <path location="lib/dom4j-1.6.1.jar" />
  </path>
   
  <taskdef name="hibernatetool"  classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />
      
  <target name="hibernateCodeGen" description="build everything">
    <hibernatetool destdir="hibernate/generated">
    <configuration propertyfile="hibernate.properties" />
    <hbm2java/>
    </hibernatetool>
  </target>

</project>


I have also a hibernate.cfg.xml 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>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/springhibernate</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">***</property>
        <property name="hibernate.default_schema">springhibernate</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    </session-factory>
</hibernate-configuration>


When I run the build.xml file using Ant, I get the following code:

Code:
hibernateCodeGen:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 12 juin 2007 16:22:13 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.2.3
[hibernatetool] 12 juin 2007 16:22:13 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 12 juin 2007 16:22:13 org.hibernate.cfg.Environment buildBytecodeProvider
[hibernatetool] INFO: Bytecode provider name : cglib
[hibernatetool] 12 juin 2007 16:22:13 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 12 juin 2007 16:22:14 org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.0.beta8
BUILD SUCCESSFUL
Total time: 1 second


But nothing is generated... I have looked for a couple of hours in the forums but I didn't get any answers.

Could you help me?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 12, 2007 12:50 pm 
Newbie

Joined: Tue Jun 12, 2007 10:25 am
Posts: 3
In the build.xml file, I changed the tag configuration to jdbcconfiguration and now it works!


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.