T - type of the entity.public abstract class LazyEntityTransactionData<T extends org.neo4j.graphdb.Entity> extends Object implements EntityTransactionData<T>
EntityTransactionData that lazily initializes its internal structures (indexed transaction data)
as they are needed by callers to prevent unnecessary overheads.| Constructor and Description |
|---|
LazyEntityTransactionData() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Iterable<org.neo4j.graphdb.event.PropertyEntry<T>> |
assignedProperties()
Get all assigned properties from the Neo4j API.
|
protected boolean |
changedContainsKey(T candidate) |
Map<String,Change<Object>> |
changedProperties(T entity)
Get properties changed in the transaction.
|
protected Change<T> |
createChangeObject(T candidate) |
protected abstract Iterable<T> |
created()
Get all entities created in the transaction from the Neo4j API.
|
Map<String,Object> |
createdProperties(T entity)
Get properties created in the transaction.
|
protected abstract Iterable<T> |
deleted()
Get all entities deleted in the transaction from the Neo4j API.
|
Map<String,Object> |
deletedProperties(T entity)
Get properties deleted in the transaction.
|
protected void |
doInitializeChanged() |
Collection<Change<T>> |
getAllChanged()
Get all entities changed in the transaction.
|
Collection<T> |
getAllCreated()
Get all entities created in the transaction.
|
Collection<T> |
getAllDeleted()
Get all entities deleted in the transaction as they were before the transaction started.
|
Change<T> |
getChanged(T entity)
Get a entity that has been changed in this transaction as it was before the transaction started and as it is now.
|
T |
getDeleted(T entity)
Get a entity that has been deleted in this transaction as it was before the transaction started.
|
boolean |
hasBeenChanged(T entity)
Check whether a entity has been changed in the transaction, i.e.
|
boolean |
hasBeenCreated(T entity)
Check whether the given entity has been created in the transaction.
|
boolean |
hasBeenDeleted(T entity)
Check whether the given entity has been deleted in the transaction.
|
boolean |
hasPropertyBeenChanged(T entity,
String key)
Check whether a property has been changed in the transaction.
|
boolean |
hasPropertyBeenCreated(T entity,
String key)
Check whether a property has been created in the transaction.
|
boolean |
hasPropertyBeenDeleted(T entity,
String key)
Check whether a property has been deleted in the transaction.
|
protected void |
initializeChanged() |
protected abstract T |
newSnapshot(T original)
Create a new snapshot of an original entity.
|
protected abstract T |
oldSnapshot(T original)
Create an old snapshot of an original entity.
|
Map<String,Object> |
propertiesOfDeletedEntity(T entity)
Get properties of a deleted entity.
|
protected void |
registerChange(T candidate) |
protected abstract Iterable<org.neo4j.graphdb.event.PropertyEntry<T>> |
removedProperties()
Get all removed properties from the Neo4j API.
|
protected abstract T oldSnapshot(T original)
original - to create a snapshot from.protected abstract T newSnapshot(T original)
original - to create a snapshot from.public boolean hasBeenCreated(T entity)
hasBeenCreated in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to check.public Collection<T> getAllCreated()
getAllCreated in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>protected abstract Iterable<T> created()
public boolean hasBeenDeleted(T entity)
hasBeenDeleted in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to check.public T getDeleted(T entity)
getDeleted in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to get.public Collection<T> getAllDeleted()
getAllDeleted in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>protected abstract Iterable<T> deleted()
public boolean hasBeenChanged(T entity)
hasBeenChanged in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to check.public Change<T> getChanged(T entity)
getChanged in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to get.public Collection<Change<T>> getAllChanged()
getAllChanged in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>protected void initializeChanged()
protected void doInitializeChanged()
protected void registerChange(T candidate)
protected boolean changedContainsKey(T candidate)
protected abstract Iterable<org.neo4j.graphdb.event.PropertyEntry<T>> assignedProperties()
protected abstract Iterable<org.neo4j.graphdb.event.PropertyEntry<T>> removedProperties()
public boolean hasPropertyBeenCreated(T entity, String key)
hasPropertyBeenCreated in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to check.key - of the property to check.public Map<String,Object> createdProperties(T entity)
createdProperties in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - for which to get created properties.public boolean hasPropertyBeenDeleted(T entity, String key)
hasPropertyBeenDeleted in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to check.key - of the property to check.public Map<String,Object> deletedProperties(T entity)
deletedProperties in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - for which to get deleted properties.public Map<String,Object> propertiesOfDeletedEntity(T entity)
propertiesOfDeletedEntity in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - deleted entity.public boolean hasPropertyBeenChanged(T entity, String key)
hasPropertyBeenChanged in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - to check.key - of the property to check.public Map<String,Change<Object>> changedProperties(T entity)
changedProperties in interface EntityTransactionData<T extends org.neo4j.graphdb.Entity>entity - for which to get changed properties.Copyright © 2013-2016–2020 Graph Aware Limited. All rights reserved.