feat: vararg overloads for the write set actions#274
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Iterableforms:insert,insertAndFetch,update,updateAndFetch,upsert,upsertAndFetchandremove. The flagship call shape reads as intended:orm.writeSet().insert(wolfie, rex, visit).Iterableforms, soWriteSetImplis untouched.Entity<?>is reifiable, which keeps the varargs warning-free without@SafeVarargs(which default interface methods cannot carry).Iterablearguments keep hitting the canonical methods, and an empty vararg call is a documented no-op.Iterableform), 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