Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Value Expressions for Repository Query methods #2956

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

marcingrzejszczak
Copy link
Contributor

fixes #2954

@marcingrzejszczak
Copy link
Contributor Author

marcingrzejszczak commented Oct 9, 2024

I've been trying to make this work but I have a couple of tests failing but only when running from Maven

[ERROR]   CypherGeneratorTest.shouldCreateRelationshipCreationQueryWithLabelIfPresent:63 expected: <MATCH (startNode:`Entity1`) WHERE startNode.id = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId MERGE (startNode)<-[relProps:`REL`]-(endNode) RETURN elementId(relProps) AS __elementId__> but was: <MATCH (startNode:`Entity1`) WHERE startNode.id = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId MERGE (startNode)<-[relProps:`REL`]-(endNode) RETURN id(relProps) AS __elementId__>
[ERROR]   CypherGeneratorTest.shouldCreateRelationshipCreationQueryWithMultipleLabels:79 expected: <MATCH (startNode:`Entity1`:`MultipleLabel`) WHERE startNode.id = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId MERGE (startNode)<-[relProps:`REL`]-(endNode) RETURN elementId(relProps) AS __elementId__> but was: <MATCH (startNode:`Entity1`:`MultipleLabel`) WHERE startNode.id = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId MERGE (startNode)<-[relProps:`REL`]-(endNode) RETURN id(relProps) AS __elementId__>
[ERROR]   CypherGeneratorTest.shouldCreateRelationshipCreationQueryWithoutUsingInternalIds:99 expected: <MATCH (startNode) WHERE id(startNode) = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId MERGE (startNode)<-[relProps:`REL`]-(endNode) RETURN elementId(relProps) AS __elementId__> but was: <MATCH (startNode) WHERE id(startNode) = $fromId MATCH (endNode) WHERE elementId(endNode) = $toId MERGE (startNode)<-[relProps:`REL`]-(endNode) RETURN id(relProps) AS __elementId__>

@meistermeier do you have any ideas what can be wrong

@michael-simons michael-simons removed their request for review October 9, 2024 10:52
@michael-simons
Copy link
Collaborator

We will look at this, but right now we are a bit time constrained.

@michael-simons
Copy link
Collaborator

Your branch doesn't even compile:

[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.366 s
[INFO] Finished at: 2024-10-10T09:26:28+02:00
[INFO] ------------------------------------------------------------------------
[INFO] 10 goals, 10 executed
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile (java-compile) on project spring-data-neo4j: Compilation failure: Compilation failure: 
[ERROR] /Users/msimons/Projects/spring-projects/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/StringBasedNeo4jQuery.java:[163,54] error: incompatible types: ValueExpressionQueryRewriter cannot be converted to EvaluatingValueExpressionQueryRewriter
[ERROR] /Users/msimons/Projects/spring-projects/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/ReactiveStringBasedNeo4jQuery.java:[121,54] error: incompatible types: ValueExpressionQueryRewriter cannot be converted to EvaluatingValueExpressionQueryRewriter

🤷

@mp911de
Copy link
Member

mp911de commented Oct 10, 2024

Build issues were introduced because or CI was broken and we weren't able to publish snapshots for commons. 9e80388 points now to proper snapshots.

@michael-simons michael-simons requested review from michael-simons and removed request for meistermeier October 10, 2024 15:57
Copy link
Collaborator

@michael-simons michael-simons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you!

@michael-simons michael-simons merged commit 359e248 into main Oct 10, 2024
1 check passed
@mp911de mp911de deleted the issue/2954 branch October 11, 2024 07:56
mp911de added a commit that referenced this pull request Oct 17, 2024
Now it is no longer evaluated as variable.

See #2956
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for value expressions in repository query methods
3 participants