I have a User domain which: 1) String username, 2) String password, 3) Roles [] roles (Roles is enum).
A method in my UserRepository is as follows:
@Query("MERGE (n:User:_User { username: \"{0}.username\", password: \"{0}.password\", roles: \"{0}.roles\" }) RETURN n")
User registerUser(User user);
This throws org.springframework.core.convert.ConversionFailedException
as it cannot convert String to Roles, which is an enum. If I get rid of the quotes around {0}.roles then it will throw this:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is org.neo4j.helpers.ThisShouldNotHappenError: Developer: Andres claims that: Need something with properties
It would be ideal if the User argument can be serialized directly into a MERGE query or any way to parse this Roles [].
Can anyone help me with this please? I was using SDN 3.1.0 and Neo4J 2.0.3.
Update1: Ideally, it'd be great to do something like:
@Query("MERGE (n:User:_User {0}) RETURN n")
User registerUser(User user);