Skip to content

Criteria/where DSL: resolve property, alias and operand meaning once, not per engine (10.0) #16917

Open

Description

@borinquenkid

Problem

The GORM criteria / where DSL has one syntax and several interpretations. Each engine (Hibernate 5, JpaQueryBuilder for bulk statements, Hibernate 7, Neo4j) walks the criteria tree itself and decides what a property name, an alias path or an operand means. The shared pieces cover only one decision each (FunctionComparison for function comparisons, CriterionScope for Neo4j property lookup, ExpressionResolver.aliasPath for Hibernate alias joins), not the walk.

So the same input means different things per engine, and review findings repeat in a new place each time:

Each fix lands in one engine, and the next review finds the neighbour.

Proposal for 10.0

One engine-neutral resolution step in datastore-core: criteria tree + root entity in, resolved form out. The engines only render it as HQL, JPQL or Cypher.

  • what each property name is: plain, identity, association, embedded, end of a relationship, function result
  • what each alias path joins
  • which operand shape each comparison has

How to get there safely

  1. One shared grid (criterion x property kind x alias shape x nesting) run unchanged against every engine. Mark each cell same, different on purpose, or different by accident. The accidental cells are the work. fix(hibernate7): support where-query functions and refactor PredicateGenerator #16816 (612 cells) and Neo4j: isNull and isNotNull on an association test the relationship #16836 (105 cells) are the first two such grids.
  2. Move the decisions into the resolver one at a time, starting with property kind.
  3. Keep Hibernate 5 behavior as the reference unless a difference is documented as intended.

Not for 8.0.x or 8.1.x: it changes a read path that works today, in four engines.

Activity

  1. added this to the grails:10.0.0-M1 milestone on Nov 10, 2026
  2. changed the title [-]Criteria/where DSL: resolve property, alias and operand meaning once, not per engine[/-] [+]Criteria/where DSL: resolve property, alias and operand meaning once, not per engine (10.0)[/+] on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions