私はneo4jデータベースで "User and Review"というテーブルを持っています。それらのデータをspringデータneo4jから取得する必要があります。ここで私はモーダルを得たくありません。しかし、私は特定の価値が必要です。 Id、メッセージ、評価などです。問題は、これらのカスタム戻り値をDbからマップする方法です。それで私を助けてください。neo4jを使用してspringデータjpaを使用してカスタム結果を取得する方法は?
サンプルクエリは、次のとおりです。
@Query("MATCH (from:User)-[r:REVIEWED]->(to:User) where r.eventId={0} return ID(r),r.message,r.rating,r.eventId,r.zimId,from.firstName,to.firstName")
public List<ReviewRelatioshipDto> getReviewsByEventIdAndId(Long eventId);
例外:
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/social] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: Scalar response queries must only return one column. Make sure your cypher query only returns one item.] with root cause
java.lang.RuntimeException: Scalar response queries must only return one column. Make sure your cypher query only returns one item.
私はクエリ結果を使用しました。それは私のために働いた。ありがとう。 –