sql - Hibernate Annotations Id for table with no primary key -
i have table has no primary key, , 1 cannot created either. can construct unique key using 3 columns of table. hibernate demands id every annotated class, how satisfy id unique id can create.
if entity type should use composite key. can done moving primary key fields separate class , mapping in entity class @id annotation.
see mapping composite primary keys , foreign keys composite primary keys
if not entity value type should map accordingly. see https://stackoverflow.com/a/1696146/324900 , entity , value types in hibernate
Comments
Post a Comment