public class Neo4jSession extends AbstractSession
Represents a session for interacting with Neo4j
Created by stefan on 03.03.14.
Modifiers | Name | Description |
---|---|---|
private static class |
Neo4jSession.RelationshipUpdateKey |
Modifiers | Name | Description |
---|---|---|
private static com.github.benmanes.caffeine.cache.RemovalListener<RelationshipUpdateKey, java.util.Collection<java.io.Serializable>> |
EXCEPTION_THROWING_INSERT_LISTENER |
|
protected org.neo4j.driver.Driver |
boltDriver |
|
protected org.neo4j.driver.Session |
boltSession |
map node id to hashmap of relationship types showing startNode id and endNode id |
private static org.slf4j.Logger |
log |
|
protected java.util.concurrent.ConcurrentMap<RelationshipUpdateKey, java.util.Collection<java.io.Serializable>> |
pendingRelationshipDeletes |
|
protected java.util.concurrent.ConcurrentMap<RelationshipUpdateKey, java.util.Collection<java.io.Serializable>> |
pendingRelationshipInserts |
Constructor and description |
---|
Neo4jSession
(Datastore datastore, MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher, boolean stateless, org.neo4j.driver.Driver boltDriver) |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addPendingRelationshipDelete(java.io.Serializable parentId, Association association, java.io.Serializable id) Adds a relationship that is pending deletion |
|
public void |
addPendingRelationshipInsert(java.io.Serializable parentId, Association association, java.io.Serializable id) Adds a relationship that is pending insertion |
|
protected void |
addRelationshipUpdate(java.io.Serializable parentId, Association association, java.io.Serializable id, java.util.Map<RelationshipUpdateKey, java.util.Collection<java.io.Serializable>> targetMap) |
|
protected java.util.Map<java.lang.String, java.util.List<java.lang.Object>> |
amendMapWithUndeclaredProperties(GraphPersistentEntity graphEntity, java.util.Map<java.lang.String, java.lang.Object> simpleProps, java.lang.Object pojo, MappingContext mappingContext) |
|
private void |
applyCustomType(EntityAccess access, PersistentProperty property, java.util.Map<java.lang.String, java.lang.Object> simpleProps) |
|
public Neo4jTransaction |
assertTransaction() |
|
public Transaction |
beginTransaction(org.springframework.transaction.TransactionDefinition transactionDefinition) |
|
protected Transaction |
beginTransactionInternal() |
|
protected Transaction |
beginTransactionInternal(org.springframework.transaction.TransactionDefinition transactionDefinition, boolean sessionCreated) |
|
private void |
buildAndExecuteCreateStatement(java.util.Collection<PendingInsert> entityInserts, GraphPersistentEntity graphEntity, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations) |
|
protected void |
buildCascadingDeletes(PersistentEntity entity, CypherBuilder baseQuery) |
|
private java.lang.String |
buildCypherCreateStatement(java.util.Collection<PendingInsert> entityInserts, GraphPersistentEntity graphEntity, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations, java.util.Map<java.lang.String, java.lang.Object> createParams) |
|
public java.lang.String |
buildEntityCreateOperation(PersistentEntity entity, PendingInsert entityInsert, java.util.Map<java.lang.String, java.lang.Object> params, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations) |
|
public void |
buildEntityCreateOperation(java.lang.StringBuilder createCypher, java.lang.String index, PersistentEntity entity, PendingInsert entityInsert, java.util.Map<java.lang.String, java.lang.Object> params, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations) |
|
protected void |
clearPendingOperations() |
|
public int |
compare(Neo4jSession.RelationshipUpdateKey o1, Neo4jSession.RelationshipUpdateKey o2) |
|
protected org.springframework.transaction.support.DefaultTransactionDefinition |
createDefaultTransactionDefinition(org.springframework.transaction.TransactionDefinition other) |
|
protected Persister |
createPersister(java.lang.Class cls, MappingContext mappingContext) |
|
public long |
deleteAll(QueryableCriteria criteria) |
|
public void |
disconnect() |
|
public void |
flush() |
|
protected void |
flushPendingDeletes(java.util.Map<PersistentEntity, java.util.Collection<PendingDelete>> pendingDeletes) |
|
protected void |
flushPendingInserts(java.util.Map<PersistentEntity, java.util.Collection<PendingInsert>> inserts) |
|
protected void |
flushPendingUpdates(java.util.Map<PersistentEntity, java.util.Collection<PendingUpdate>> updates) |
|
public org.neo4j.driver.Driver |
getBoltDriver() |
|
public Neo4jDatastore |
getDatastore() |
|
public Neo4jEntityPersister |
getEntityPersister(java.lang.Object o) Gets a Neo4jEntityPersister for the given object |
|
public Neo4jMappingContext |
getMappingContext() |
|
public org.neo4j.driver.Session |
getNativeInterface() |
|
private java.util.List<java.lang.Object> |
getOrInit(java.util.Map<java.lang.String, java.util.List<java.lang.Object>> dynRelProps, java.lang.String key) |
|
public Neo4jTransaction |
getTransaction() |
|
public boolean |
hasTransaction() |
|
public static boolean |
isCollectionWithPersistentEntities(java.lang.Object o, MappingContext mappingContext) |
|
private boolean |
isVetoedAfterPreOperations(PendingInsert entityInsert) |
|
private void |
persistDirtyButUnsavedInstances() in case a known instance is modified and not explicitly saved, we track dirty state here and spool them for persisting |
|
protected void |
postFlush(boolean hasUpdates) |
|
private void |
processDynamicAssociationsIfNecessary(GraphPersistentEntity graphEntity, EntityAccess access, java.lang.Object obj, PendingInsert entityInsert, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations, java.util.Map<java.lang.String, java.lang.Object> params, java.util.Map<java.lang.String, java.util.List<java.lang.Object>> dynamicRelProps) |
|
private void |
processInsertsForEntity(org.neo4j.driver.Transaction neo4jTransaction, GraphPersistentEntity entity, java.util.Map<PersistentEntity, java.util.Collection<PendingInsert>> inserts, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations) |
|
private void |
processPendingRelationshipUpdates(GraphPersistentEntity entity, EntityAccess access, java.io.Serializable id, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations, boolean isUpdate) |
|
private void |
processPendingRelationshipUpdates(EntityAccess parent, java.io.Serializable parentId, Association association, java.util.List<PendingOperation<java.lang.Object, java.io.Serializable>> cascadingOperations, boolean isUpdate) |
|
private java.util.Map<java.lang.String, java.lang.Object> |
readNodePropertiesForInsert(PendingInsert entityInsert, GraphPersistentEntity graphEntity, java.util.List<PersistentProperty> persistentProperties, EntityAccess access) |
|
private void |
startDefaultTransaction() |
|
public long |
updateAll(QueryableCriteria criteria, java.util.Map<java.lang.String, java.lang.Object> properties) |
|
protected boolean |
wasTransactionTerminated() |
map node id to hashmap of relationship types showing startNode id and endNode id
Adds a relationship that is pending deletion
association
- The associationid
- The idAdds a relationship that is pending insertion
association
- The associationid
- The idGets a Neo4jEntityPersister for the given object
o
- The objectin case a known instance is modified and not explicitly saved, we track dirty state here and spool them for persisting