-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Mutation
-
None
Translate the OptionalTableUpdate built for StatelessSession.upsert and upsertMultiple into a single update statement: filter from the key bindings, $set over value bindings that are both insertable and updatable, $setOnInsert for insertable-only ones (@Column(updatable = false)), upsert: true, multi: false.
Includes groundwork the conflict-clause tickets build on:
- AstUpdateCommand restructured to a list of update statements with upsert and multi flags
- AstDocumentUpdate gains $setOnInsert
- MongoStatement accepts upsert in update statements and extends the JDBC row count to matched plus upserted
- a visitor value descriptor so the dialect requests the upsert translation of visitOptionalTableUpdate, which also serves the forced version-increment update
Rejections are all deferred to performMutation so SessionFactory bootstrap never fails: @Column(insertable = false, updatable = true) attributes (MQL has no matched-path-only write) and entities whose only persistent attribute is the identifier throw bare messages; @Version entities keep throwing, tracked by HIBERNATE-216.
- depends on
-
HIBERNATE-218 Translate HQL INSERT ... ON CONFLICT with a field-list target to an upsert
-
- Needs Triage
-
- is related to
-
HIBERNATE-216 Support StatelessSession.upsert on @Version entities
-
- Needs Triage
-