@java.lang.SuppressWarnings({"rawtypes", "unchecked"})
public abstract class AbstractDatastore
extends java.lang.Object
implements Datastore, ServiceRegistry, StatelessDatastore
Abstract Datastore implementation that deals with binding the Session to thread locale upon creation.
| Modifiers | Name | Description |
|---|---|---|
protected static Logger |
LOG |
|
protected ApplicationEventPublisher |
applicationEventPublisher |
|
protected TPCacheAdapterRepository |
cacheAdapterRepository |
|
protected PropertyResolver |
connectionDetails |
|
protected MappingContext |
mappingContext |
|
protected ServiceRegistry |
serviceRegistry |
| Constructor and description |
|---|
AbstractDatastore(MappingContext mappingContext) |
AbstractDatastore(MappingContext mappingContext, java.util.Map<java.lang.String, java.lang.Object> connectionDetails, ConfigurableApplicationContext ctx) |
AbstractDatastore(MappingContext mappingContext, PropertyResolver connectionDetails, ConfigurableApplicationContext ctx) |
AbstractDatastore(MappingContext mappingContext, PropertyResolver connectionDetails, ConfigurableApplicationContext ctx, TPCacheAdapterRepository cacheAdapterRepository) |
AbstractDatastore(MappingContext mappingContext, java.util.Map<java.lang.String, java.lang.Object> connectionDetails, ConfigurableApplicationContext ctx, TPCacheAdapterRepository cacheAdapterRepository) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Session |
connect() |
|
public final Session |
connect(PropertyResolver connDetails) |
|
public Session |
connectStateless() |
|
protected abstract Session |
createSession(PropertyResolver connectionDetails)Creates the native session |
|
protected Session |
createStatelessSession(PropertyResolver connectionDetails)Creates the native stateless session |
|
public void |
destroy()Closes every session held by the current thread's SessionHolder, if any. |
|
public T |
doInSession(Session session) |
|
public ConfigurableApplicationContext |
getApplicationContext()
|
|
public ApplicationEventPublisher |
getApplicationEventPublisher()
|
|
public Session |
getCurrentSession() |
|
public MappingContext |
getMappingContext() |
<T> |
public T |
getService(java.lang.Class<T> interfaceType) |
<T extends Service> |
public java.lang.Iterable<T> |
getServices() |
|
public SessionResolver |
getSessionResolver()
|
|
public boolean |
hasCurrentSession()
|
|
protected void |
initializeConverters(MappingContext mappingContext) |
|
protected boolean |
isIndexed(PersistentProperty property) |
|
public boolean |
isSchemaless() |
|
protected static PropertyResolver |
mapToPropertyResolver(java.util.Map<java.lang.String, java.lang.Object> connectionDetails) |
|
public static Session |
retrieveSession()Static way to retrieve the session |
|
public static Session |
retrieveSession(java.lang.Class datastoreClass)Static way to retrieve the session |
|
public void |
setApplicationContext(ApplicationContext ctx) |
<T> |
public T |
withSession(groovy.lang.Closure<T> callable) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Creates the native session
connectionDetails - The session detailsCreates the native stateless session
connectionDetails - The session details Closes every session held by the current thread's SessionHolder, if any. Since
TransactionSynchronizationManager is thread-local, this only reaches the thread
invoking @PreDestroy - sessions bound on other threads are not visible here and must
be closed by their own owning thread. A holder that is synchronized with an active Spring
transaction is left alone: DatastoreTransactionManager still owns those sessions and
will operate on them during commit or rollback.
null if this datastore was constructed without an
ApplicationContext and no subclass provides its own publisher
Static way to retrieve the session
Static way to retrieve the session
datastoreClass - The type of datastore