0 Replies Latest reply on Jan 17, 2008 3:50 AM by parag.goyal

    Index is not being created on Table

    parag.goyal

      Hi All,

      we are using



      JBoss-4.2.2 .GA that contains hibernate 3.2 jar

      Postgre SQL 8.2



      We are using specification of EJB 3.0



      Applying @org.hibernate.annotations.Index (name = " fk", columnNames = "coloum Name of Related table") on relationship object



      eg:- we have a class department having one-to-many relationship with employees

      Now Inside Department Class



      @Entity

      public class Department

      {



      @OneToMany

      (cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = " mDepartment ")

      @Index(name = "fykeyDpt ", columnNames = "mDepartment")

      public List emp;



      }



      On database level we want index in employee table.



      It is working fine and creating index with the below settings in persistence.xml.



      But the problem is that if we are changing the value=update then no index is created.

      f.i. As per our project requirement we have to stick with update.



      If some body having the solution or any alternative solution for creating index please let us know.



      Thaks in advance.