【发布时间】:2014-08-16 16:18:08
【问题描述】:
我是 Neo4j 和 SDN 的新手。我试图使用@Indexed(unique=true) 为我的实体创建主键。它创建唯一节点,但如果我使用索引的相同属性值,它将替换其他属性。 例如:
Class abc{
@Indexed(unique=true)
Long abc_id;
String abc_name;
}
new abc(1,"asd")// creates node with id: 1 name : asd
new abc(1,"xyz")// replaces asd with xyz .
但是我想抛出一个关于主键违规/重复节点的异常。
有没有办法达到同样的效果?
【问题讨论】: