Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.graphaware;
- import org.neo4j.graphdb.DynamicLabel;
- import org.neo4j.graphdb.schema.ConstraintCreator;
- import org.neo4j.unsafe.batchinsert.BatchInserter;
- import org.neo4j.unsafe.batchinsert.BatchInserters;
- import java.util.Collections;
- import java.util.Date;
- import static org.neo4j.helpers.collection.MapUtil.map;
- /**
- * Created by luanne on 03/02/15.
- */
- public class LabelTokenIsReferencedTwiceFromSameNode {
- public static void main(String[] args) {
- String path = "/tmp/test" + new Date().getTime() + ".graph.db";
- System.out.println("path = " + path);
- BatchInserter inserter = BatchInserters.inserter(path, Collections.EMPTY_MAP);
- inserter.createNode(map("itemId", 1000l), DynamicLabel.label("Item"), DynamicLabel.label("Item"));
- ConstraintCreator constraintCreator = inserter.createDeferredConstraint(DynamicLabel.label("Item"));
- constraintCreator.assertPropertyIsUnique("itemId").create();
- inserter.shutdown();
- /*
- Consistency check produces
- Full consistency check
- 2015-02-03 10:08:07.375+0000 INFO [org.neo4j]: ERROR: The label token record is referenced twice from the same node.
- Node[0,used=true,rel=-1,prop=0,labels=Inline(0x2000000000:[0, 0]),light]
- Inconsistent with: 0
- ......2015-02-03 10:08:07.405+0000 INFO [org.neo4j]: ERROR: The label token record is referenced twice from the same node.
- Node[0,used=true,rel=-1,prop=0,labels=Inline(0x2000000000:[0, 0]),light]
- Inconsistent with: 0
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement