Hibernate annotation, JPA如何對映多個屬性為unique

jander發表於2007-05-28
例如一個表如下:
CREATE TABLE MyObject(
ID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
OBJECT_CLASS BIGINT NOT NULL,
OBJECT_IDENTITY BIGINT NOT NULL,
CONSTRAINT UNIQUE_UK_3 UNIQUE(OBJECT_CLASS,OBJECT_IDENTITY)
);
用domain class 如何表示這個表呢?謝謝。
注意:要將object_class和object_identity兩個欄位聯合成uique.

相關文章