2 Replies Latest reply on Apr 18, 2006 10:37 AM by leonell

    How to add (non-referential, performance) index?

    leonell

      Hello,
      I need to add index for better performance (non-referential index).
      I found one way: using org.hibernate.annotation.Index.

      It works fine but:
      1) this is Hibernate only solution. Does exist some EJB3 annotation?
      2) with Hibernate annotation is index correctly created when "create-drop" type is used but not with "update" type.

      EJB3-RC6 with JBOSS 4.0.4-CR2

      Do you have some ideas?
      Leonell

        • 1. Re: How to add (non-referential, performance) index?
          mwoelke

          Hi,
          There is no index annotation for EJB 3.
          We ran into this problem ourselfs. What you can do is:
          use the hibernate annotation, which I personally dislike, since it gets you hibernate dependend, as you already pointed out. The other option is to use hbm.xml files to describe these aspects of your entities. As the documentation states mixing of annotations and hbm.xml files should be working.

          Of course you can always patch hibernate.

          Regards, Milan Wölke

          • 2. Re: How to add (non-referential, performance) index?
            leonell

            I will use Hibernate annotation @Index.
            But why is @Index ignored when hibernate.hbm2ddl.auto type is set to "update"?
            Bug or feature?

            I also do not understand why does not exist similar annotation in official EJB3 standard
            because I dont know any real database with no additional indexes.


            Leonell