neo4j / sdn-rx

Nextgen Spring Data module for Neo4j supporting (not only) reactive data access and immutable support
https://neo4j.github.io/sdn-rx
Apache License 2.0
65 stars 23 forks source link

SPeL: Possible mark parameter as used. #138

Closed michael-simons closed 4 years ago

michael-simons commented 4 years ago

Given

@Query("MATCH (s:Person) -[:PARENT] -> (u:Union) MATCH (u) <- [:PARENT] - (a) WHERE id(s) = :#{#person.id} RETURN u,a")
List<UnionEntity> findAllUnionsInvolvingParent(PersonEntity person);

The SPeL expression works as expected but the person parameter still get's passed to the Cypher generator. Driver cannot do anything with a domain class.

The question here is: Do we want to pass that parameter on or not?

meistermeier commented 4 years ago

There is no option to determine which parameters has been used for a SpEL expression. A pragmatic idea to avoid passing objects like the PersonEntity above could be to just filter complex object instances but there might be cases where a converter is in place for such instances.

IMHO the downside of passing more parameter values than needed avoids a lot of complexity in the parameter checking and filtering.

michael-simons commented 4 years ago

I agree with both points. The issue can be reopened if needed.