Beispiel #1
0
 @Override
 public Map<String, Object> getRelationshipProperties(long relId) {
   RelationshipRecord record =
       recordAccess.getRelRecords().getOrLoad(relId, null).forChangingData();
   if (record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue()) {
     return getPropertyChain(record.getNextProp());
   }
   return Collections.emptyMap();
 }
Beispiel #2
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();
 }
Beispiel #3
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;
 }
Beispiel #4
0
 private RecordProxy<Long, RelationshipRecord, Void> getRelationshipRecord(long id) {
   if (id < 0 || id >= getRelationshipStore().getHighId()) {
     throw new NotFoundException("id=" + id);
   }
   return recordAccess.getRelRecords().getOrLoad(id, null);
 }
Beispiel #5
0
 @Override
 public boolean relationshipHasProperty(long relationship, String propertyName) {
   return primitiveHasProperty(
       recordAccess.getRelRecords().getOrLoad(relationship, null).forReadingData(), propertyName);
 }