@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) public abstract class AbstractSession extends AbstractAttributeStoringSession
Abstract implementation of the Session interface that uses a list of Persister instances to save, update and delete instances
Modifiers | Name | Description |
---|---|---|
protected TPCacheAdapterRepository |
cacheAdapterRepository |
|
protected java.util.Map<java.lang.Class, java.util.Map<java.io.Serializable, java.lang.Object>> |
firstLevelCache |
|
protected java.util.Map<CollectionKey, java.util.Collection> |
firstLevelCollectionCache |
|
protected java.util.Map<java.lang.Class, java.util.Map<java.io.Serializable, java.lang.Object>> |
firstLevelEntryCache |
|
protected java.util.Map<java.lang.Class, java.util.Map<java.io.Serializable, java.lang.Object>> |
firstLevelEntryCacheDirtyCheck |
|
protected java.util.concurrent.ConcurrentLinkedQueue |
lockedObjects |
|
protected java.util.Map<java.lang.Object, java.io.Serializable> |
objectToKey |
|
protected java.util.Collection<java.lang.Runnable> |
pendingDeletes |
|
protected java.util.Map<java.lang.Class, Persister> |
persisters |
|
protected java.util.Collection<java.lang.Runnable> |
postFlushOperations |
|
protected org.springframework.context.ApplicationEventPublisher |
publisher |
Fields inherited from class | Fields |
---|---|
class AbstractAttributeStoringSession |
attributes |
Constructor and description |
---|
AbstractSession
(Datastore datastore, MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher) |
AbstractSession
(Datastore datastore, MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher, TPCacheAdapterRepository cacheAdapterRepository) |
Type | Name and description |
---|---|
void |
addPendingInsert(PendingInsert insert) |
void |
addPendingUpdate(PendingUpdate update) |
void |
addPostFlushOperation(java.lang.Runnable runnable) |
void |
attach(java.lang.Object o) |
Transaction |
beginTransaction() |
protected Transaction |
beginTransactionInternal() |
void |
cacheCollection(PersistentEntity entity, java.io.Serializable key, java.util.Collection collection, java.lang.String name) |
void |
cacheEntry(PersistentEntity entity, java.io.Serializable key, java.lang.Object entry) |
protected void |
cacheEntry(java.io.Serializable key, java.lang.Object entry, java.util.Map<java.io.Serializable, java.lang.Object> entryCache, boolean forDirtyCheck) |
void |
cacheInstance(java.lang.Class type, java.io.Serializable key, java.lang.Object instance) |
protected void |
cacheObject(java.io.Serializable identifier, java.lang.Object o) |
void |
clear() |
void |
clear(java.lang.Object o) |
boolean |
contains(java.lang.Object o) |
protected Persister |
createPersister(java.lang.Class cls, MappingContext mappingContext) |
Query |
createQuery(java.lang.Class type) |
void |
delete(java.lang.Object obj) |
void |
delete(java.lang.Iterable objects) |
int |
deleteAll(QueryableCriteria criteria) This default implementation of the deleteAll method is unlikely to be optimal as it iterates and deletes each object. |
void |
flush() |
protected void |
flushPendingInserts(java.util.Map<PersistentEntity, java.util.Collection<PendingInsert>> inserts) The default implementation of flushPendingInserts is to iterate over each insert operations and execute them one by one. |
protected void |
flushPendingUpdates(java.util.Map<PersistentEntity, java.util.Collection<PendingUpdate>> updates) The default implementation of flushPendingUpdates is to iterate over each update operation and execute them one by one. |
java.util.Collection |
getCachedCollection(PersistentEntity entity, java.io.Serializable key, java.lang.String name) |
java.lang.Object |
getCachedEntry(PersistentEntity entity, java.io.Serializable key) |
java.lang.Object |
getCachedEntry(PersistentEntity entity, java.io.Serializable key, boolean forDirtyCheck) |
java.lang.Object |
getCachedInstance(java.lang.Class type, java.io.Serializable key) |
Datastore |
getDatastore() |
javax.persistence.FlushModeType |
getFlushMode() |
MappingContext |
getMappingContext() |
java.util.Collection<java.lang.Runnable> |
getPendingDeletes() |
java.util.Map<PersistentEntity, java.util.Collection<PendingInsert>> |
getPendingInserts() |
java.util.Map<PersistentEntity, java.util.Collection<PendingUpdate>> |
getPendingUpdates() |
Persister |
getPersister(java.lang.Object o) |
Transaction |
getTransaction() |
boolean |
isCached(java.lang.Class type, java.io.Serializable key) |
boolean |
isDirty(java.lang.Object instance) |
void |
lock(java.lang.Object o) |
java.lang.Object |
lock(java.lang.Class type, java.io.Serializable key) |
java.io.Serializable |
persist(java.lang.Object o) |
java.util.List<java.io.Serializable> |
persist(java.lang.Iterable objects) |
protected void |
postFlush(boolean hasUpdates) |
java.lang.Object |
proxy(java.lang.Class type, java.io.Serializable key) |
void |
refresh(java.lang.Object o) |
java.lang.Object |
retrieve(java.lang.Class type, java.io.Serializable key) |
java.util.List |
retrieveAll(java.lang.Class type, java.lang.Iterable keys) |
java.util.List |
retrieveAll(java.lang.Class type, java.io.Serializable... keys) |
void |
setFlushMode(javax.persistence.FlushModeType flushMode) |
void |
unlock(java.lang.Object o) |
int |
updateAll(QueryableCriteria criteria, java.util.Map<java.lang.String, java.lang.Object> properties) This default implementation of updateAll is unlikely to be optimal as it iterates and updates each object one by one. |
Methods inherited from class | Name |
---|---|
class AbstractAttributeStoringSession |
disconnect, getAttribute, isConnected, setAttribute |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
This default implementation of the deleteAll method is unlikely to be optimal as it iterates and deletes each object. Subclasses should override to optimize for the batch operation capability of the underlying datastore
criteria
- The criteriaThe default implementation of flushPendingInserts is to iterate over each insert operations and execute them one by one. This may be suboptimal for stores that support batch insert operations. Subclasses can override this method to implement batch insert more efficiently.
inserts
- The insert operationsThe default implementation of flushPendingUpdates is to iterate over each update operation and execute them one by one. This may be suboptimal for stores that support batch update operations. Subclasses can override this method to implement batch update more efficiently.
This default implementation of updateAll is unlikely to be optimal as it iterates and updates each object one by one. Subclasses should override to optimize for the batch operation capability of the underlying datastore
criteria
- The criteriaproperties
- The properties