- Domain Model
- Identifiers
- Simple identifiers
- Composite identifiers
- Composite identifiers with @EmbeddedId
- Composite identifiers with @IdClass
- Composite identifiers with associations
- Generated identifier values
- Interpreting AUTO
- Using sequences
- Using IDENTITY columns
- Using identifier table
- Using UUID generation
- Optimizers
- Using @GenericGenerator
- Derived Identifiers
- Identifiers
Identifiers 对应的 database column
- UNIQUE
- NOT NULL - The values cannot be null. For composite ids, no part can be null.
- IMMUTABLE - The values, once inserted, can never be changed
In cases where the values for the PK you have chosen will be updated, Hibernate recommends mapping the mutable value as a natural id, and use a surrogate id for the PK