neo4j - Can't recreate just deleted node with UniqueNodeFactory -
i created node uniquenodefactory , relationship uniquerelationshipfactory. deleted the node neoeclipse , tried recreate same node , no exception , node it's not recreated again. knows happening?
public node getorcreatenodewithuniquefactory(final index<node> nodeindex, final string indexablekey,final string indexablevalue) { uniquefactory<node> factory = new uniquefactory.uniquenodefactory( global.graphdb.getgraphdbservice(), nodeindex.getname()) { @override protected void initialize(node created, map<string, object> properties) { created.setproperty(indexablekey, properties.get(indexablekey)); } }; return factory.getorcreate( indexablekey, indexablevalue ); } public relationship getorcreaterelationshiptypewithuniquefactory(index<relationship> index, string indexablekey, final string indexablevalue, final relationshiptype type, final node start, final node end) { uniquefactory<relationship> factory = new uniquefactory.uniquerelationshipfactory(index) { @override protected relationship create(map<string, object> properties) { relationship r = start.createrelationshipto(end, type); return r; } }; return factory.getorcreate(indexablekey, indexablevalue); }
i can't reproduce issue. there's new node created second time around. full source code. , try method "getorcreatewithoutcome" on uniquenodefactory see whether created or not.
Comments
Post a Comment