Every entity must have a primary key. Primary key can be
simple or composite.
Simple Primary Key
Simple primary key corresponds to a single persistent
fields or property of the class. @Id annotation is used to define a simple
primary key.
Composite primary key
It is a combination of more than one persistent field. The
EmbeddedId or IdClass annotation is used to denote a composite primary key.
No comments:
Post a Comment