在 Spring data neo4j 3.x 中创建两个节点之间的关系,并且关系包含一组属性,这些属性早先用于通过 apis 实现这一点
create :
n4jOperations.createRelationshipBetween(Object start, Object end, Class<R> relationshipEntityClass, String relationshipType, boolean allowDuplicates);
delete:
n4jOperations.deleteRelationshipBetween(Object start, Object end, String type);
get:
n4jOperations.getRelationshipBetween( from, to, relationshipClass, relationshipType );
但是迁移后我没有找到上面的api
根据文档说
@NodeEntity
public class Student {
private String name;
@Relationship(type = "ENROLLED")
private Set<Enrollment> enrollments;
}
By repo.save(Student);
//关系创建是可能的,但新的api我如何实现以下用例
1.如何避免重复创建关系?
2.获取两个节点之间的关系?
2.删除两个节点之间的关系?