[jboss-user] [EJB 3.0] - Re: Hibernate specific @Index annotation is ignored

Rhodan do-not-reply at jboss.com
Tue May 20 07:39:18 EDT 2008

We are using:

Jboss 4.2.2 GA
Hibernate EntityManager 3.2.1.GA
Hibernate Annotations 3.2.1.GA
Hibernate 3.2.4.sp1

Following example for defining the index:

  | @Column
  | @org.hibernate.annotations.Index(name = "test_idx")
  | public String getUserName() {
  |      return this.userName;
  | }

Bug seems to be related to the persistence.xml entry:
<property name="hibernate.hbm2ddl.auto" value="create-drop" />

Index generation ONLY works when hibernate.hbm2ddl.auto is set to "create-drop", in any other case the index is NOT created. I'm shure, anybody understands, that 'create-drop' is not an appropriate value for production systems.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151971#4151971

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151971

More information about the jboss-user mailing list