You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Entities such as
Node
andRelationship
are not named by default. The indirect inheritance is plain wrong.The text was updated successfully, but these errors were encountered: