Hello,
I'm working on simple application with Spring, JPA (Hibernate) and Apache Derby. All my entyties are definied with annotations. Because I'm using maven dependency management I would like to create the ddl for Apache Derby with the hbm2ddl plugin. Basically no problem. But I've realised that no unique constraints are created. Regardless if I define it with the @UniqueConstraint or the @NaturalId annotation. Even properties with the @NotNull annotation are not null. But all the 'create table'-statements are created correctly. I'm using the following configuration for the hbm2ddl plugin:
Code:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<dependencies>
...
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>annotationconfiguration</implementation>
</component>
<componentProperties>
<persistenceunit>XXX</persistenceunit>
<outputfilename>db-schema.sql</outputfilename>
<propertyfile>hbm2ddl.properties</propertyfile>
<implementation>annotationconfiguration</implementation>
<scan-classes>true</scan-classes>
<jdk5>true</jdk5>
<ejb3>true</ejb3>
<drop>true</drop>
<create>true</create>
<export>true</export>
<format>true</format>
<haltonerror>true</haltonerror>
</componentProperties>
</configuration>
</plugin>
Thank you
Lothar