Skip to content

feat: vararg overloads for the write set actions#274

Merged
zantvoort merged 1 commit into
mainfrom
feat/write-set-varargs
Jul 15, 2026
Merged

feat: vararg overloads for the write set actions#274
zantvoort merged 1 commit into
mainfrom
feat/write-set-varargs

Conversation

@zantvoort

Copy link
Copy Markdown
Collaborator

Summary

  • All seven write set actions accept entities as varargs next to the canonical Iterable forms: insert, insertAndFetch, update, updateAndFetch, upsert, upsertAndFetch and remove. The flagship call shape reads as intended: orm.writeSet().insert(wolfie, rex, visit).
  • The overloads are default methods delegating to the Iterable forms, so WriteSetImpl is untouched. Entity<?> is reifiable, which keeps the varargs warning-free without @SafeVarargs (which default interface methods cannot carry).
  • Overload resolution is unchanged for existing shapes: single-entity and typed single-root overloads keep winning one-argument calls in both Java and Kotlin, Iterable arguments keep hitting the canonical methods, and an empty vararg call is a documented no-op.
  • The write-sets reference now uses the vararg shape wherever entities are enumerated inline (the collection examples keep the Iterable form), matching the comparison pages shipped in docs: compare JPA cascades with Storm write sets (reference + tutorial) #272.

Verification

  • WriteSetIntegrationTest (storm-core): 25 existing tests plus vararg insert/update/remove round trip and empty-call no-ops (27 total, green).
  • WriteSetTest (storm-kotlin): vararg resolution exercised from Kotlin (7 total, green).

Fixes #273

All seven actions accept entities as varargs next to the canonical
Iterable forms: insert, insertAndFetch, update, updateAndFetch, upsert,
upsertAndFetch and remove. The overloads are default methods delegating
to the Iterable forms; Entity<?> is reifiable, so they are warning-free
without @SafeVarargs. Single-entity and typed single-root overloads
keep winning one-argument resolution in both Java and Kotlin, and an
empty call is a no-op.

The write-sets reference now shows the vararg shape where entities are
enumerated inline, matching the comparison pages shipped in #272.

Fixes #273
@zantvoort zantvoort merged commit a228024 into main Jul 15, 2026
7 checks passed
@zantvoort zantvoort deleted the feat/write-set-varargs branch July 15, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vararg overloads for the WriteSet actions

1 participant