Spring Data Neo4J @Indexed(unique = true) not working

前端 未结 2 416
被撕碎了的回忆
被撕碎了的回忆 2021-01-18 07:11

I\'m new to Neo4J and I have, probably an easy question.

There\'re NodeEntitys in my application, a property (name) is annotated with @Indexed(unique = true) to achi

2条回答
  •  天涯浪人
    2021-01-18 07:33

    If you are using SDN 3.2.0+ use the failOnDuplicate attribute:

    public class Role extends BaseEntity
    {
        @Indexed(unique = true, failOnDuplicate = true)
        private String name;
        ...
    }
    

提交回复
热议问题