Unique Index in Spring Data Neo4j

236 views
Skip to first unread message

Abdul Azeez Shaik

unread,
May 20, 2012, 1:03:36 PM5/20/12
to ne...@googlegroups.com
Dear,

Unique index type in SDN is not working for me. Just wanted to check if it is a known issue?
I am using latest SDN and Neo4j1.7 stable version.

Here is my index configuration,

@Indexed(indexName="dummy", indexType=IndexType.UNIQUE)

String dummy;

Whereas other indexes are working pretty fine.

Thanks,

Abdul

Tero Paananen

unread,
May 20, 2012, 2:33:29 PM5/20/12
to ne...@googlegroups.com
It's @Indexed( indexName="dummy", indexType=IndexType.Simple, unique=true)

Unchecked, not in front of a computer right -now.

-TPP

Abdul Azeez Shaik

unread,
May 21, 2012, 2:05:57 AM5/21/12
to ne...@googlegroups.com
Hi Tero,

Thanks for the response. This one is working. 
Though, the 'new' entity has not been created, repo.save() is not throwing any exception or error for duplicates. Is there a way to know that this is the duplicate entity?

Thanks in advance.

Regards,
 Abdul

Michael Hunger

unread,
May 21, 2012, 4:10:26 AM5/21/12
to ne...@googlegroups.com
Right now thats the semantics for uniqueness in Neo4j it is rather a getOrCreate() 

I'm not sure about communicating duplicates. We might add a attribute to @Indexed that'll cause an exception on duplicate entity creation.

Sent from mobile device
Reply all
Reply to author
Forward
0 new messages