Hello,
I try to use Hibernate Tools with jpa configuration in my project to get the sql code , everything work good and the ant task run ok but the ddl file generated was empty
Hibernate version:3.2.0
this is my ant build file :
Code:
<?xml version="1.0"?>
<project name="decheterie" default="hbm2ddl" basedir=".">
<property name="lib" value="./../target/decheterie-0.0.1/WEB-INF/lib" />
<path id="toolslib">
<path location="${lib}/hibernate-tools-3.2.0.beta8.jar" />
<path location="${lib}/hibernate-3.2.0.cr4.jar" />
<path location="${lib}/freemarker-2.3.8.jar" />
<path location="${lib}/jtds-1.2.jar" />
<path location="${lib}/commons-logging-1.1.jar" />
<path location="${lib}/dom4j-1.6.1.jar" />
</path>
<path id="jpatoolslib">
<path refid="toolslib"/>
<path location="${lib}/hibernate-annotations-3.2.1.ga.jar" />
<path location="${lib}/persistence-api-1.0.jar" />
<path location="${lib}/hibernate-entitymanager-3.2.1.ga.jar" />
<path location="${lib}/jboss-archive-browsing-5.0.0alpha-200607201-119.jar" />
<path location="${lib}/javassist-3.3.ga.jar" />
</path>
<!--
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="jpatoolslib" />
-->
<target name="hbm2ddl" description="export the schema DDL to file" >
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" >
<classpath refid="jpatoolslib" />
</taskdef>
<hibernatetool destdir="./../target">
<jpaconfiguration persistenceunit="dd-web"/>
<classpath>
<path location="./../target/decheterie-0.0.1/WEB-INF/classes" />
</classpath>
<hbm2ddl export="false" outputfilename="tt.sql" format="true"/>
</hibernatetool>
</target>
</project>
this is my persistence.xml :
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="dd-web" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.webtiss.sita.de.model.Operateur</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.connection.url"
value="jdbc:jtds:sqlserver://localhost:1433/waste;tds=8.0;lastupdatecount=true"/>
<property name="hibernate.connection.username"
value="sita1"/>
<property name="hibernate.connection.password"
value="8fdKJl3$nlNv3049jsKK"/>
</properties>
</persistence-unit>
</persistence>
is there any ideas ?