I'm trying to take an annotated object and turn it into a db schema. The object I'm testing this out on is a simple object with only an interger(id), and two strings. The only annotation is the @Entity(from javax.persistence). I'm using the latest hibernate-tools (alpha5) with the following code from maven.xml:
Code:
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="maven.dependency.classpath">
<classpath>
<pathelement location="lib/hibernate-tools-3.0.0.alpha5.jar" />
<path refid="maven.dependency.classpath"/>
</classpath>
</taskdef>
<hibernatetool destdir="target/hibernate">
<classpath>
<path location="target/classes"/>
<pathelement location="lib/ejb-3.0.jar" />
</classpath>
<annotationconfiguration configurationfile="src/webapp/WEB-INF/hibernate.cfg.xml"/>
<hbm2ddl drop="false"/>
</hibernatetool>
The hibernate.cfg.xml is the following:
Code:
<hibernate-configuration>
<session-factory name="hibernateSession">
<property name="hibernate.connection.driver_class">
org.postgresql.Driver
</property>
<property name="hibernate.connection.url">
jdbc:postgresql:template1
</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">
org.hibernate.dialect.PostgreSQLDialect
</property>
<mapping class="model.Province" />
</session-factory>
</hibernate-configuration>
With the above, and running the task for maven.xml I get the following error:
Code:
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
BUILD FAILED
File...... /.../maven.xml
Element... hibernatetool
Line...... 14
Column.... 46
org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;)V
More info below. If I should post more info, let me know.
Thanks,
Chris
Hibernate version: 3.1alpha1 Mapping documents: Using annotations, just a simple @Entity for an object without any relations, etc.Full stack trace of any exception that occurs: Code:
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
BUILD FAILED
File...... /.../maven.xml
Element... hibernatetool
Line...... 14
Column.... 46
org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;)V
Name and version of the database you are using: Postgresql 7.4.8