Ejemplo n.º 1
0
 @Override
 public void setNodeProperty(long node, String propertyName, Object newValue) {
   propertyCreator.setPrimitiveProperty(
       getNodeRecord(node),
       getOrCreatePropertyKeyId(propertyName),
       newValue,
       recordAccess.getPropertyRecords());
   recordAccess.commit();
 }
Ejemplo n.º 2
0
 @Override
 public void setRelationshipProperty(
     long relationship, String propertyName, Object propertyValue) {
   propertyCreator.setPrimitiveProperty(
       getRelationshipRecord(relationship),
       getOrCreatePropertyKeyId(propertyName),
       propertyValue,
       recordAccess.getPropertyRecords());
   recordAccess.commit();
 }
Ejemplo n.º 3
0
 @Override
 public void setRelationshipProperties(long rel, Map<String, Object> properties) {
   RelationshipRecord record = recordAccess.getRelRecords().getOrLoad(rel, null).forChangingData();
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     propertyDeletor.getAndDeletePropertyChain(record, recordAccess.getPropertyRecords());
   }
   record.setNextProp(
       propertyCreator.createPropertyChain(
           record, propertiesIterator(properties), recordAccess.getPropertyRecords()));
   recordAccess.commit();
 }
Ejemplo n.º 4
0
 @Override
 public void setNodeProperties(long node, Map<String, Object> properties) {
   NodeRecord record = getNodeRecord(node).forChangingData();
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     propertyDeletor.getAndDeletePropertyChain(record, recordAccess.getPropertyRecords());
   }
   record.setNextProp(
       propertyCreator.createPropertyChain(
           record, propertiesIterator(properties), recordAccess.getPropertyRecords()));
   recordAccess.commit();
 }
Ejemplo n.º 5
0
  private long internalCreateNode(long nodeId, Map<String, Object> properties, Label... labels) {
    NodeRecord nodeRecord = recordAccess.getNodeRecords().create(nodeId, null).forChangingData();
    nodeRecord.setInUse(true);
    nodeRecord.setCreated();
    nodeRecord.setNextProp(
        propertyCreator.createPropertyChain(
            nodeRecord, propertiesIterator(properties), recordAccess.getPropertyRecords()));

    if (labels.length > 0) {
      setNodeLabels(nodeRecord, labels);
    }

    recordAccess.commit();
    return nodeId;
  }
Ejemplo n.º 6
0
 @Override
 public long createRelationship(
     long node1, long node2, RelationshipType type, Map<String, Object> properties) {
   long id = neoStore.getRelationshipStore().nextId();
   int typeId = getOrCreateRelationshipTypeToken(type);
   relationshipCreator.relationshipCreate(id, typeId, node1, node2, recordAccess);
   if (properties != null && !properties.isEmpty()) {
     RelationshipRecord record =
         recordAccess.getRelRecords().getOrLoad(id, null).forChangingData();
     record.setNextProp(
         propertyCreator.createPropertyChain(
             record, propertiesIterator(properties), recordAccess.getPropertyRecords()));
   }
   recordAccess.commit();
   return id;
 }