-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This addresses and fixes #547 to some extend. The goal was to allow compilation of ```java var cypher = Cypher.match(person) .returning( person, Expressions.count(person.relationshipTo(person, "ACTED_IN")).as("acted_in_rel_count") ).build(); ``` without aliasing the `person` node with `as`. This could be achieved by allowing `IdentifiableElement` on the `returning` methods the same way this PR does with the `with` methods. However, in contrast to `with`, `return` does allow non-aliased expressions, so the overload taking in `Expression` must continue to exists. That will rule out to add another overload with a `Collection<SomethingElse>`, as they will have the same type erasure as existing methods. Adding a varg of `IdentifiableElement` will break a gazillion lines of code, even in our tests, as the method will then be ambiguous. I think the original sin was having `Node` and `Relationship` indirectly implement `Named` through `PropertyContainer`. If that wasn't the case, `Named` could become an expression and things will resolve nicely without additional overloads. That change however would take several engineering weeks and turn the DSL inside out and can't be part of this change. We created #550 for the next major release after `2023.0.0` to track this issue. This change here will require some changes to calling code of `with`, but getting rid of about 250 LoC is worth the change, in addition, `with` will actually be nicer.
- Loading branch information
1 parent
251838b
commit 10080df
Showing
16 changed files
with
253 additions
and
544 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.