Spring data neo4j 查询问题 很简单 请大佬指点一下
Optional<Person> byId11 = personRepository.findById(3824L);
查询时候 Person 里面的 Set<Person2> 一直是空 , 怎么让他有值啊 ????
@Data @NodeEntity( label = “person”) @NoArgsConstructor @AllArgsConstructor public class Person implements Serializable { @Id @GeneratedValue private Long id; private String name; @Relationship(type = “夫妻” , direction=Relationship.INCOMING) private Set<Person2> person2 ; }
@Data @NodeEntity( label = “person2”) @NoArgsConstructor @AllArgsConstructor public class Person2 implements Serializable { @Id @GeneratedValue private Long id; private String name; }