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
If I'm not doing anything wrong, I've found a bug during the query creation where it's using Neo4J's id() function instead of elementId() when I'm defining queries by their names on an interface repository.
Here it's the relevant entity and repository that I'm creating:
The query findByPostedByUsernameIn works fine, but the others don't. Here's the log (debug mode) messages related to this query
2024-03-15T15:53:28.607-03:00 DEBUG 1837551 --- [nio-8080-exec-1] o.s.data.neo4j.cypher-normal : Executing:
MATCH (postEntity:`Post`) WHERE id(postEntity) IN $ids RETURN postEntity{.body, .createdAt, .title, __nodeLabels__: labels(postEntity), __elementId__: elementId(postEntity), Post_POSTED_User: [(postEntity)<-[:`POSTED`]-(postEntity_postedBy:`User`) | postEntity_postedBy{.createdAt, .name, .username, __nodeLabels__: labels(postEntity_postedBy), __elementId__: elementId(postEntity_postedBy)}], Post_REACTED_User: [(postEntity)<-[Post__relationship__User:`REACTED`]-(postEntity_reactedBy:`User`) | postEntity_reactedBy{.createdAt, .name, .username, __nodeLabels__: labels(postEntity_reactedBy), __elementId__: elementId(postEntity_reactedBy), Post__relationship__User}]}
2024-03-15T15:56:11.924-03:00 WARN 1837551 --- [nio-8080-exec-2] o.s.data.neo4j.cypher.deprecation : Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
MATCH (postEntity:`Post`) WHERE id(postEntity) IN $ids RETURN postEntity{.body, .createdAt, .title, __nodeLabels__: labels(postEntity), __elementId__: elementId(postEntity), Post_POSTED_User: [(postEntity)<-[:`POSTED`]-(postEntity_postedBy:`User`) | postEntity_postedBy{.createdAt, .name, .username, __nodeLabels__: labels(postEntity_postedBy), __elementId__: elementId(postEntity_postedBy)}], Post_REACTED_User: [(postEntity)<-[Post__relationship__User:`REACTED`]-(postEntity_reactedBy:`User`) | postEntity_reactedBy{.createdAt, .name, .username, __nodeLabels__: labels(postEntity_reactedBy), __elementId__: elementId(postEntity_reactedBy), Post__relationship__User}]}
^
The query used a deprecated function: `id`.
Some important info:
findById works as expected, using elementId()
I have the bean configuring Dialect.NEO4J_5 (during the debug I made sure it's working properly)
After digging into the code, I believe the problem is at CypherQueryCreator.toCypherProperty method that doesn't check if it should use elementId() or id(). I planned to open a PR with a fix but since I don't now the code base and couldn't find an easy way to do a check similar to the one I've found here. So I decided to open this issue instead. Please lemme know if I'm missing something or if I can help fixing it!
The text was updated successfully, but these errors were encountered:
There is a convenient function if the property in derived queries
refers to the internal id to use the `id` / `elementId` function.
This was never taken into consideration when the elementId support
got introduced.
The fix is straight forward in line with the existing call to
`Cypher.call("id")` to avoid introducing more changes to the
infrastructure.
Also includes fixture for the logging capture based tests around
elementId/id to catch the right log output again.
Closes#2879
There is a convenient function if the property in derived queries
refers to the internal id to use the `id` / `elementId` function.
This was never taken into consideration when the elementId support
got introduced.
The fix is straight forward in line with the existing call to
`Cypher.call("id")` to avoid introducing more changes to the
infrastructure.
Also includes fixture for the logging capture based tests around
elementId/id to catch the right log output again.
Closes#2879
Hi, first of all, thanks for the project!
If I'm not doing anything wrong, I've found a bug during the query creation where it's using Neo4J's
id()
function instead ofelementId()
when I'm defining queries by their names on an interface repository.Here it's the relevant entity and repository that I'm creating:
The query
findByPostedByUsernameIn
works fine, but the others don't. Here's the log (debug mode) messages related to this querySome important info:
findById
works as expected, usingelementId()
Dialect.NEO4J_5
(during the debug I made sure it's working properly)After digging into the code, I believe the problem is at CypherQueryCreator.toCypherProperty method that doesn't check if it should use
elementId()
orid()
. I planned to open a PR with a fix but since I don't now the code base and couldn't find an easy way to do a check similar to the one I've found here. So I decided to open this issue instead. Please lemme know if I'm missing something or if I can help fixing it!The text was updated successfully, but these errors were encountered: