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