-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Model
-
None
Supported
Composite primary keys declared with @EmbeddedId (a plain @Embeddable). @Struct on the id embeddable is neither required nor needed.
The key is stored as the document's _id sub-document, with a stable field order. For an entity keyed on (publisherId, bookNo):
{ "_id": { "publisherId": 1, "bookNo": 1 }, "title": "..." }
Application-assigned only (composite keys are never generated).
Operations:
- persist / find / update / delete by id
- HQL filtering by the whole id (=, in) and by individual id fields
- selecting the id or an id field
- order by id
- bulk update / delete by id
Associations to a composite-key entity depend on HIBERNATE-164 (compound equijoin ON); end-to-end support to be verified once 164 lands.
Out of scope
- @jakarta.persistence.IdClass composite keys
- depends on
-
HIBERNATE-210 Support HQL row-value (tuple) predicates: =, <>, IN
-
- Closed
-