Typed Criteria query API on JavaRepository (intent glue foundation) - #6050
Merged
Conversation
Adds a small fluent Criteria builder (eq/ne/gt/ge/lt/le/like/between/in/ isNull/isNotNull + orderBy) and JavaRepository.findAll(Criteria), the type-safe alternative to hand-writing HQL. Criteria renders to an HQL fragment plus a named-parameter map (values are bound, never inlined; property names are validated to plain identifiers to prevent injection) and runs through JavaEntityStore's existing map-projection query path. This is the query surface the intent declarative-glue catalog (e.g. a scheduled "find Loans where dueOn < today and status = ACTIVE") uses instead of raw HQL. Covered by CriteriaTest. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds a typed, fluent
Criteriaquery API to the client-JavaJavaRepository, so glue and hand-written client code can filter rows type-safely instead of hand-writing HQL.This is the query surface the declarative-glue catalog needs — e.g. a scheduled "find overdue loans" activity (see
engine-intent/CLAUDE.md→ "Planned: declarative glue", Tier 1 #3).How
Criteria(indata-store-java'srepositorypackage, next toJavaRepository— the package client code already imports from):eq/ne/gt/ge/lt/le/like/between/in/isNull/isNotNull+orderByAsc/Desc. Renders to an HQL fragment + a named-parameter map.eq("status; drop table", …)throws.JavaRepository.findAll(Criteria)→JavaEntityStore.findAll(type, criteria), which buildsfrom <entityName> …and reuses the existing map-projectionquery(...)path (returns typedT). No new Hibernate plumbing, no new module dependency.Testing
CriteriaTest(4 cases, unit-level, no DB) covers AND-combination + parameter binding, BETWEEN/IN/null checks, and the injection-rejection guard. Run green locally (Tests run: 4, Failures: 0).🤖 Generated with Claude Code