Support StatelessSession.upsert on unversioned entities

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Major - P3
    • 1.0.0
    • Affects Version/s: None
    • Component/s: Mutation
    • None
    • 3
    • None
    • Needed
    • None
    • None
    • None
    • None
    • None
    • 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.

            Assignee:
            Jeffrey Yemin
            Reporter:
            Jeffrey Yemin
            Almas Abdrazak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: