Indexes (non-unique)
From the viewpoint of software modelling non-unique indexes are not part of the business logic but refer to database optimization. Consequently JPA has no support for non-unique indexes.
On the other hand performance matters. Hibernate and other
persistence providers offer vendor specific JPA
extensions. We may find it useful to access
hibintro.v5.User
instances having a specific
cname
quickly. This can be achieved by adding a Hibernate
specific
org.hibernate.annotations.
org.hibernate.annotations.Table
index generating annotation ❶
which works on top of JPA's
javax.persistence.
javax.persistence.Table
:
Java |
|
Sql |
|