I have a class extending an existing object with one table strategy (which I cannot change). I want to use UniqueConstraint for this object, so I tried:
@Entity @Table(name = "t_document") public class Document implements Serializable { ... }
and
@Entity @Table(uniqueConstraints = { @UniqueConstraint(name = "Test", columnNames = { ... }) }) public class MyDocument extends Document { ... }
The unique restriction is not used at all, nothing in the log file. Is this the right way to use UniqueConstraints in this situation?
(We use JPA2, JBoss 7.1)
java hibernate jpa unique-constraint single-table-inheritance
Haiko
source share