neo4j - SpringDataNeo4j-4 derived finders with custom queries -
i using springdataneo4j–4.1.0-build-snapshot. access database using “extends graphrepository" structure , neo4jtemplate. among other things using simple derived finder queries like:
event findbyid (long id)
this works fine , returns results expected. have cases want find entry property retrieve relationships:
@query("match (n:event{dbid:{0}})-[r:species|figure]->(m) return n,r,m") event findbyid (long id)
i know right not supported. there possible workaround behaviour without having construct object on own , implemented in future versions of sdn since ogm 2.0.0-m01 offers possibility perform queries this?
you can use neo4jtemplate.query
, retrieve "n" result
.
n event
that's been hydrated properties , relationships species
, 'figure`.
or, can instead create @queryresult
repository method annotated custom query
returns, , you'll still hydrated event.
this functionality available in sdn 4.1 snapshot (4.1.0.build-snapshot)
your query above @query("match (n:event{dbid:{0}})-[r:species|figure]->(m) return return n,r,m") event findbyid (long id)
not supported because there 3 entities returned query, single 1 expected returned.
Comments
Post a Comment