jamesfredley commented on code in PR #16836:
URL: https://github.com/apache/grails-core/pull/16836#discussion_r4487605357
##########
grails-data-neo4j/core/src/main/groovy/org/grails/datastore/gorm/neo4j/engine/Neo4jQuery.groovy:
##########
@@ -772,7 +800,15 @@ class Neo4jQuery extends Query {
builder.addMatch(
entity.formatAssociationPatternFromExisting(association, relationship, prefix,
targetNodeName)
)
- return dispatchCriterion(aq.criteria, entity, builder,
nextPrefix)
+ // The nested criteria are about the associated entity, so a
property is looked up there: a
+ // plain property of the same name as an association of the
entity the query started from is
+ // still a plain property, and an association of the
associated entity is tested as one. An
+ // association to a relationship entity keeps the entity it
was given, as its properties
+ // are those of the relationship.
+ PersistentEntity associated = association.associatedEntity
+ GraphPersistentEntity nested = associated instanceof
GraphPersistentEntity &&
Review Comment:
connections { isNull('spouse') } still looks up spouse on the owning node
when the block is a relationship entity. If that node has a spouse association
and the relationship has a scalar spouse, the query builds a relationship
pattern from a relationship variable. Neo4j rejects it. The same test used to
be m_0.spouse IS NULL. Test the scalar on the relationship.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]