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
I walked into the same trap... as long as you create new entities, you will not see the exception - the last save()-action wins the battle.
Unfortunately, the DataIntegrityViolationException will be raised only in case of update an existing entity!
A detailed description of that behaviour can be found here: http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#d5e1035
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;
...
}