public void create( RelationshipRecord record ) { record.setCreated(); update( new RelationshipRecord( record.getId() ), record ); }
private Command visitRelationshipCommand( ReadableChannel channel ) throws IOException { long id = channel.getLong(); RelationshipRecord before = readRelationshipRecord( id, channel ); if ( before == null ) { return null; } RelationshipRecord after = readRelationshipRecord( id, channel ); if ( after == null ) { return null; } if ( !before.inUse() && after.inUse() ) { after.setCreated(); } return new Command.RelationshipCommand( before, after ); }
private Command visitRelationshipCommand( ReadableChannel channel ) throws IOException { long id = channel.getLong(); RelationshipRecord before = readRelationshipRecord( id, channel ); if ( before == null ) { return null; } RelationshipRecord after = readRelationshipRecord( id, channel ); if ( after == null ) { return null; } if ( !before.inUse() && after.inUse() ) { after.setCreated(); } return new Command.RelationshipCommand( before, after ); }
public static RelationshipCommand createRelationship( long id, long startNode, long endNode, int type ) { RelationshipRecord before = new RelationshipRecord( id ); before.setInUse( false ); RelationshipRecord after = new RelationshipRecord( id, startNode, endNode, type ); after.setInUse( true ); after.setCreated(); return new RelationshipCommand( before, after ); }
rel.setCreated(); if ( cacheAccess.getFromCache( nodeId, SLOT_SOURCE_OR_TARGET ) == SOURCE )
/** * Creates a relationship with the given id, from the nodes identified by id * and of type typeId * * @param id The id of the relationship to create. * @param type The id of the relationship type this relationship will * have. * @param firstNodeId The id of the start node. * @param secondNodeId The id of the end node. */ public void relationshipCreate( long id, int type, long firstNodeId, long secondNodeId, RecordAccessSet recordChangeSet, ResourceLocker locks ) { // TODO could be unnecessary to mark as changed here already, dense nodes may not need to change NodeRecord firstNode = recordChangeSet.getNodeRecords().getOrLoad( firstNodeId, null ).forChangingLinkage(); NodeRecord secondNode = recordChangeSet.getNodeRecords().getOrLoad( secondNodeId, null ).forChangingLinkage(); convertNodeToDenseIfNecessary( firstNode, recordChangeSet.getRelRecords(), recordChangeSet.getRelGroupRecords(), locks ); convertNodeToDenseIfNecessary( secondNode, recordChangeSet.getRelRecords(), recordChangeSet.getRelGroupRecords(), locks ); RelationshipRecord record = recordChangeSet.getRelRecords().create( id, null ).forChangingLinkage(); record.setLinks( firstNodeId, secondNodeId, type ); record.setInUse( true ); record.setCreated(); connectRelationship( firstNode, secondNode, record, recordChangeSet.getRelRecords(), recordChangeSet.getRelGroupRecords(), locks ); }
record.setCreated();
record.setCreated();
record.setCreated();
record.setCreated();
public void create( RelationshipRecord relationship ) { relationship.setCreated(); update( relationship ); }
private Command visitRelationshipCommand( ReadableChannel channel ) throws IOException { long id = channel.getLong(); RelationshipRecord before = readRelationshipRecord( id, channel ); if ( before == null ) { return null; } RelationshipRecord after = readRelationshipRecord( id, channel ); if ( after == null ) { return null; } if ( !before.inUse() && after.inUse() ) { after.setCreated(); } return new Command.RelationshipCommand( before, after ); }
private Command visitRelationshipCommand( ReadableChannel channel ) throws IOException { long id = channel.getLong(); RelationshipRecord before = readRelationshipRecord( id, channel ); if ( before == null ) { return null; } RelationshipRecord after = readRelationshipRecord( id, channel ); if ( after == null ) { return null; } if ( !before.inUse() && after.inUse() ) { after.setCreated(); } return new Command.RelationshipCommand( before, after ); }
/** * Creates a relationship with the given id, from the nodes identified by id * and of type typeId * * @param id The id of the relationship to create. * @param type The id of the relationship type this relationship will * have. * @param firstNodeId The id of the start node. * @param secondNodeId The id of the end node. */ public void relationshipCreate( long id, int type, long firstNodeId, long secondNodeId, RecordAccessSet recordChangeSet, ResourceLocker locks ) { // TODO could be unnecessary to mark as changed here already, dense nodes may not need to change NodeRecord firstNode = recordChangeSet.getNodeRecords().getOrLoad( firstNodeId, null ).forChangingLinkage(); NodeRecord secondNode = recordChangeSet.getNodeRecords().getOrLoad( secondNodeId, null ).forChangingLinkage(); convertNodeToDenseIfNecessary( firstNode, recordChangeSet.getRelRecords(), recordChangeSet.getRelGroupRecords(), locks ); convertNodeToDenseIfNecessary( secondNode, recordChangeSet.getRelRecords(), recordChangeSet.getRelGroupRecords(), locks ); RelationshipRecord record = recordChangeSet.getRelRecords().create( id, null ).forChangingLinkage(); record.setLinks( firstNodeId, secondNodeId, type ); record.setInUse( true ); record.setCreated(); connectRelationship( firstNode, secondNode, record, recordChangeSet.getRelRecords(), recordChangeSet.getRelGroupRecords(), locks ); }
record.setCreated();
record.setCreated();
record.setCreated();
record.setCreated();