private List<Pair<String, Object>> getPropertiesFromRecord( long recordId ) { final PropertyRecord record = propertyStore().getRecord( recordId, propertyStore().newRecord(), RecordLoad.FORCE ); final List<Pair<String, Object>> props = new ArrayList<>(); record.forEach( block -> { final Object value = propertyStore().getValue( block ).asObject(); final String name = propertyStore().getPropertyKeyTokenStore().getToken( block.getKeyIndexId() ).name(); props.add( pair( name, value ) ); } ); return props; }
/** * This method exists since {@link #wrapStore(RecordStore)} might depend on the existence of a variable * that gets set in a subclass' constructor <strong>after</strong> this constructor of {@link StoreAccess} * has been executed. I.e. a correct creation of a {@link StoreAccess} instance must be the creation of the * object plus a call to {@link #initialize()}. * * @return this */ public StoreAccess initialize() { this.schemaStore = wrapStore( neoStores.getSchemaStore() ); this.nodeStore = wrapStore( neoStores.getNodeStore() ); this.relStore = wrapStore( neoStores.getRelationshipStore() ); this.propStore = wrapStore( neoStores.getPropertyStore() ); this.stringStore = wrapStore( neoStores.getPropertyStore().getStringStore() ); this.arrayStore = wrapStore( neoStores.getPropertyStore().getArrayStore() ); this.relationshipTypeTokenStore = wrapStore( neoStores.getRelationshipTypeTokenStore() ); this.labelTokenStore = wrapStore( neoStores.getLabelTokenStore() ); this.nodeDynamicLabelStore = wrapStore( wrapNodeDynamicLabelStore( neoStores.getNodeStore().getDynamicLabelStore() ) ); this.propertyKeyTokenStore = wrapStore( neoStores.getPropertyStore().getPropertyKeyTokenStore() ); this.relationshipTypeNameStore = wrapStore( neoStores.getRelationshipTypeTokenStore().getNameStore() ); this.labelNameStore = wrapStore( neoStores.getLabelTokenStore().getNameStore() ); this.propertyKeyNameStore = wrapStore( neoStores.getPropertyStore().getPropertyKeyTokenStore().getNameStore() ); this.relGroupStore = wrapStore( neoStores.getRelationshipGroupStore() ); return this; }
/** * This method exists since {@link #wrapStore(RecordStore)} might depend on the existence of a variable * that gets set in a subclass' constructor <strong>after</strong> this constructor of {@link StoreAccess} * has been executed. I.e. a correct creation of a {@link StoreAccess} instance must be the creation of the * object plus a call to {@link #initialize()}. * * @return this */ public StoreAccess initialize() { this.schemaStore = wrapStore( neoStores.getSchemaStore() ); this.nodeStore = wrapStore( neoStores.getNodeStore() ); this.relStore = wrapStore( neoStores.getRelationshipStore() ); this.propStore = wrapStore( neoStores.getPropertyStore() ); this.stringStore = wrapStore( neoStores.getPropertyStore().getStringStore() ); this.arrayStore = wrapStore( neoStores.getPropertyStore().getArrayStore() ); this.relationshipTypeTokenStore = wrapStore( neoStores.getRelationshipTypeTokenStore() ); this.labelTokenStore = wrapStore( neoStores.getLabelTokenStore() ); this.nodeDynamicLabelStore = wrapStore( wrapNodeDynamicLabelStore( neoStores.getNodeStore().getDynamicLabelStore() ) ); this.propertyKeyTokenStore = wrapStore( neoStores.getPropertyStore().getPropertyKeyTokenStore() ); this.relationshipTypeNameStore = wrapStore( neoStores.getRelationshipTypeTokenStore().getNameStore() ); this.labelNameStore = wrapStore( neoStores.getLabelTokenStore().getNameStore() ); this.propertyKeyNameStore = wrapStore( neoStores.getPropertyStore().getPropertyKeyTokenStore().getNameStore() ); this.relGroupStore = wrapStore( neoStores.getRelationshipGroupStore() ); return this; }