feat!: root-inheriting predicate combinators; fix docs naming nonexistent methods - #447
Merged
Conversation
- Point the collection-parameter error at whereId(ids)/where(path, IN, values)
instead of the nonexistent whereAny/whereAll builder methods.
- Replace the phantom whereAny convention in the WhereBuilder docs (Kotlin and
Java) with the real cross-table composition via andAny/orAny or custom
template strings.
- Rewrite Kotlin KDoc examples to use whereBuilder { } and the resultList
property instead of the Java-only where-lambda and getResultList().
- Fix copy-pasted javadoc on DbTable, DbColumn and the EQUALS/NOT_EQUALS
operator labels.
- Guard the column parameter in the built-in operators: a null column now
throws instead of silently rendering "null = ?". The display-name null
check it replaces was unreachable.
Fixes #406
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… twins andAny/orAny were the predicate-level Any variants #372 left behind. The combinators now follow the same model as the clauses: the query root decides what combines. - Java: every predicate carries the builder's root, so and/or absorb the Any twins with a ? extends T parameter; a narrow builder combines within the root graph and a join widens the root. The twins had no constructible argument with a foreign root left. - Kotlin: and/or move into the whereBuilder { } scope as member extensions bound to the scope's root, so a narrow scope combines within the root graph and a widened scope combines predicates across joined entities with the same syntax. Top-level and/or extensions combine same-rooted predicates outside a scope. - Core keeps a permissive ? extends Data parameter: it is the engine the Kotlin bridge feeds mixed-root predicates through, and query-time validation reports paths on entities outside the query.
The core and/or parameters tighten from ? extends Data to ? extends T, the same level where operates at. The bridges' arguments are within the receiver's root in every sound path: narrow scopes guarantee same-root by their public signatures, and a widened scope's root is Data itself, so the permissive parameter stated less than what every caller already proves.
The Kotlin surface had the cross-entity and case; core and storm-java21 predicates on a widened builder were untested, and no surface covered or. Pets joined with owners: name = 'Leo' AND owner 'Davis' finds Betty's Leo; OR also admits Harold Davis's Iggy.
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.
Closes the documentation and error-message drift reported in #406, and completes the #372 join-widening model at the predicate level, which that report surfaced.
Docs and error messages
TemplateProcessornow points at real API,whereId(ids)orwhere(path, IN, values), instead of the nonexistentwhereAny/whereAllbuilder methods.whereAnyconvention in theWhereBuilderclass docs is replaced with the join-widening model. This also existed in thestorm-java21variant, which the issue did not list, and is fixed there as well.whereBuilder { }and theresultListproperty instead of the Java-onlywhere-lambda andgetResultList(), and compile as written against the current API.DbTablespecifies the table or view name (optionally its schema),DbColumnthe column name, andEQUALS/NOT_EQUALSare labeled=/<>rather than EXISTS/NOT EXISTS.Operatormoves from the display name, which is never null, to the column parameter via arequireColumnhelper in every built-in operator. A null column now throwsIllegalArgumentExceptioninstead of silently renderingnull = ?. The zero-placeholderIN/NOT_INforms never reference the column and still render their constant expressions.Predicate combinators inherit the query root
andAny/orAnywere the predicate-level Any variants #372 left behind; writing docs that pointed users at them made that visible. They are removed from every API, andand/orfollow the clause model: the query root decides what combines.storm-java21): every predicate carries the builder's root, soand/orabsorb the Any twins with a? extends Tparameter. A narrow builder combines within the root graph; a join widens the root. Post-feat!: a join widens the query, replacing the Any clause variants #372 the twins had no constructible argument with a foreign root left.and/ormove into thewhereBuilder { }scope as member extensions bound to the scope's root. A narrow scope combines within the root graph; a join widens the root, and the same expression combines predicates across joined entities, e.g.(petName eq "Leo") and (ownerLastName eq "Davis")after joiningOwner. Top-leveland/orextensions combine same-rooted predicates outside a scope. A new integration test covers the cross-entity case after a join.and/ortake? extends T, the levelwhereoperates at. The bridges present their arguments within the receiver's root, which holds in every sound path: narrow scopes guarantee same-root by their public signatures, and a widened scope's root isDataitself. Query-time validation reports paths on entities outside the query.Verified with full builds of storm-foundation, storm-core (2603 tests), storm-java21 (541) and storm-kotlin (1714, including the new cross-entity test) on JDK 21, plus a full reactor compile.
Fixes #406