I want to query all the relationship satisfied some condition. And here's the node,
@Data
@Node
public class Resource {
@Id
@GeneratedValue
private Long id;
@Property("name")
private String name;
private String code;
@Property("parent_code")
private String parentCode;
private String label;
// @Relationship
// private List<Neo4jRelationship> relationship = new ArrayList<>();
}
Here's the relationship
@Data
@RelationshipProperties
public class Neo4jRelationship {
@RelationshipId
private Long id;
@TargetNode
private Resource startNode;
}
Here's the cypher:
@Query("match p = (a : category_first {name: $name})-[*1..2]-() return p")
List<Neo4jRelationship> getFistCatNode(@Param("name") String name);
which returns an empty list, And if I change the return type to Object, like:
@Query("match p = (a : category_first {name: $name})-[*1..2]-() return p")
List<Object> getFistCatNode(@Param("name") String name);
The cypher can return normally, but I can't get the internal field.
What should I do. Any help will be grateful