我正在尝试Type
从我的 Neo4j 数据库中删除所有 's。我有一个Type
类的存储库typeRepository
,我称之为typeRepository.deleteAll();
. 但是,并非所有内容都被删除。仅删除其节点,使该BusinessLogic
节点在数据库中处于活动状态。我不确定此时还可以尝试什么,因为它的方法名称暗示它将删除所有事物,包括自身和与自身相关的事物。这是我的持久类的外观,它扩展了我的数据库包含的对象的基本类型:
@NodeEntity
public class BaseType {
@GraphId
private Long id;
@Indexed(unique=true) String uid;
private String name;
BaseType() {}
BaseType(String name) {
this.name = name;
}
}
,
public class Type extends BaseType {
@RelatedTo(type="businessLogic")
@Fetch
private BusinessLogic businessLogic;
public Type() {super();}
public Type(String name, BusinessLogic businessLogic) {
super(name);
this.businessLogic = businessLogic;
}
}
,
@NodeEntity
@XmlAccessorType(XmlAccessType.NONE)
public class BusinessLogic implements Serializable {
@GraphId
private Long id;
private static final long serialVersionUID = -634875134095817304L;
@XmlElement
private String create;
public void setCreate(String create) {
this.create = create;
}
public String getCreate() {
return create;
}
}
我只存储Type
实例,我通过调用来做到这一点
typeRepository.save(new Type(name, businessLogic));
.