cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Dot operator not working for @Query in SDN 6

Upon upgrading to SDN 6, all of a sudden I cannot query using an internal property via dot operator. Using SDN 6.1.7 from....

org.springframework.boot spring-boot-starter-parent 2.5.8

3X_6_1_6107d7433dd60bc2155f23d701ab07f37204563f.png
3X_0_e_0e5690b1651d8f40229e3496f49bb2efb9adaae1.png

1 REPLY 1

Sorry for the delayed answer but I haven't seen the question before in the general Java section.

The conversion of entities as parameters follow the basic principle of mapping in SDN e.g. a Player object might look like:

{
0: {__labels__: ["Player"], __id__: null, __properties__: {name: "player1"}},
testNode: {__labels__: ["Player"], __id__: null, __properties__: {name: "player1"}}
}

(The repetition with index based and named variable is due to the fact that we also support Spring Expression Language position-based parameters)
This means that you would have to add the __properties__ part in the query and as a result it would look like this:

@Query("MATCH (myPlayer:Player {name: $playerIn.__properties__.name}) RETURN myPlayer")
Player findPlayerByPlayer(@Param("playerIn") Player player);

There is a section in our documentation that does mention this in the example part: Custom query parameters