This content has been marked as final. Show 1 reply
I use the @Index annotation (org.hibernate.annotations.Index) for create index if I set in persistence.xml:
not work with:
property name="hibernate.hbm2ddl.auto" value="update"
This is a bug? Exists a solution?
I have the same experience with Postgresql.
But there is other question:
Do you need it?
In real life you typically use more SQL commands for DB creations.
You need optimize tablespaces, specify domains, and other, server related, settings.
Every SQL server has different setting - you cannot solve it in one EAR.
You can use SQL script for database creation and you (or SQL admin) will run it before deploy. Or you can use small GUI application where you will create database, modify settings and with full your control create structure of database.
And also note:
When you use 'org.hibernate.annotations.Index' annotation then your application will work with Jboss AS (Hibernate) only because this annotation is not part of EJB3 specification.