Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. package com.graphaware;
  2.  
  3. import org.neo4j.graphdb.DynamicLabel;
  4. import org.neo4j.graphdb.schema.ConstraintCreator;
  5. import org.neo4j.unsafe.batchinsert.BatchInserter;
  6. import org.neo4j.unsafe.batchinsert.BatchInserters;
  7.  
  8. import java.util.Collections;
  9. import java.util.Date;
  10.  
  11. import static org.neo4j.helpers.collection.MapUtil.map;
  12.  
  13. /**
  14. * Created by luanne on 03/02/15.
  15. */
  16. public class LabelTokenIsReferencedTwiceFromSameNode {
  17.  
  18. public static void main(String[] args) {
  19. String path = "/tmp/test" + new Date().getTime() + ".graph.db";
  20. System.out.println("path = " + path);
  21.  
  22. BatchInserter inserter = BatchInserters.inserter(path, Collections.EMPTY_MAP);
  23.  
  24. inserter.createNode(map("itemId", 1000l), DynamicLabel.label("Item"), DynamicLabel.label("Item"));
  25.  
  26. ConstraintCreator constraintCreator = inserter.createDeferredConstraint(DynamicLabel.label("Item"));
  27. constraintCreator.assertPropertyIsUnique("itemId").create();
  28.  
  29. inserter.shutdown();
  30.  
  31. /*
  32. Consistency check produces
  33.  
  34. Full consistency check
  35. 2015-02-03 10:08:07.375+0000 INFO [org.neo4j]: ERROR: The label token record is referenced twice from the same node.
  36. Node[0,used=true,rel=-1,prop=0,labels=Inline(0x2000000000:[0, 0]),light]
  37. Inconsistent with: 0
  38. ......2015-02-03 10:08:07.405+0000 INFO [org.neo4j]: ERROR: The label token record is referenced twice from the same node.
  39. Node[0,used=true,rel=-1,prop=0,labels=Inline(0x2000000000:[0, 0]),light]
  40. Inconsistent with: 0
  41. */
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement