use of org.neo4j.kernel.impl.store.record.RecordLoad in project neo4j by neo4j.
the class Loaders method propertyLoader.
public static RecordLoader<PropertyRecord, PrimitiveRecord> propertyLoader(final PropertyStore store, CursorContext cursorContext) {
return new RecordLoader<>(store, cursorContext) {
@Override
public PropertyRecord newUnused(long key, PrimitiveRecord additionalData) {
PropertyRecord record = new PropertyRecord(key);
setOwner(record, additionalData);
return andMarkAsCreated(record);
}
private void setOwner(PropertyRecord record, PrimitiveRecord owner) {
if (owner != null) {
owner.setIdTo(record);
}
}
@Override
public PropertyRecord load(long key, PrimitiveRecord additionalData, RecordLoad load, CursorContext cursorContext) {
PropertyRecord record = super.load(key, additionalData, load, cursorContext);
setOwner(record, additionalData);
return record;
}
@Override
public PropertyRecord copy(PropertyRecord propertyRecord) {
return new PropertyRecord(propertyRecord);
}
};
}
Aggregations