public abstract class AbstractHibernateDatastore extends AbstractDatastore implements org.springframework.context.ApplicationContextAware, MultipleConnectionSourceCapableDatastore, SchemaMultiTenantCapableDatastore, Settings, TransactionCapableDatastore, java.io.Closeable, org.springframework.context.MessageSourceAware
Datastore implementation that uses a Hibernate SessionFactory underneath.
Modifiers | Name | Description |
---|---|---|
enum |
AbstractHibernateDatastore.FlushMode |
We use a separate enum here because the classes differ between Hibernate 3 and 4 |
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
CONFIG_PROPERTY_CACHE_QUERIES |
|
static java.lang.String |
CONFIG_PROPERTY_OSIV_READONLY |
|
static java.lang.String |
CONFIG_PROPERTY_PASS_READONLY_TO_HIBERNATE |
|
protected AutoTimestampEventListener |
autoTimestampEventListener |
|
protected ConnectionSources<org.hibernate.SessionFactory, HibernateConnectionSourceSettings> |
connectionSources |
|
protected java.lang.String |
dataSourceName |
|
protected int |
defaultFlushMode |
|
protected java.lang.String |
defaultFlushModeName |
|
protected AbstractHibernateEventListener |
eventTriggeringInterceptor |
|
protected boolean |
failOnError |
|
protected boolean |
isCacheQueries |
|
protected boolean |
markDirty |
|
protected MultiTenancyMode |
multiTenantMode |
|
protected boolean |
osivReadOnly |
|
protected boolean |
passReadOnlyToHibernate |
|
protected SchemaHandler |
schemaHandler |
|
protected org.hibernate.SessionFactory |
sessionFactory |
|
protected TenantResolver |
tenantResolver |
Fields inherited from class | Fields |
---|---|
class AbstractDatastore |
LOG, cacheAdapterRepository, connectionDetails, mappingContext, serviceRegistry |
Constructor and description |
---|
protected AbstractHibernateDatastore(ConnectionSources<org.hibernate.SessionFactory, HibernateConnectionSourceSettings> connectionSources, HibernateMappingContext mappingContext) |
protected AbstractHibernateDatastore(MappingContext mappingContext, org.hibernate.SessionFactory sessionFactory, org.springframework.core.env.PropertyResolver config, org.springframework.context.ApplicationContext applicationContext, java.lang.String dataSourceName) |
AbstractHibernateDatastore(MappingContext mappingContext, org.hibernate.SessionFactory sessionFactory, org.springframework.core.env.PropertyResolver config) |
Type Params | Return Type | Name and description |
---|---|---|
|
public T |
call(java.lang.Object args) |
|
public void |
close() |
|
protected ValidatorRegistry |
createValidatorRegistry(org.springframework.context.MessageSource messageSource) |
|
public void |
destroy() |
|
public void |
disableMultiTenancyFilter() Disable the tenant id filter for the given datastore and entity |
|
public void |
enableMultiTenancyFilter() Enable the tenant id filter for the given datastore and entity |
|
public AutoTimestampEventListener |
getAutoTimestampEventListener()
|
|
public ConnectionSources<org.hibernate.SessionFactory, HibernateConnectionSourceSettings> |
getConnectionSources() |
|
public javax.sql.DataSource |
getDataSource()
|
|
public java.lang.String |
getDataSourceName()
|
|
public abstract AbstractHibernateDatastore |
getDatastoreForConnection(java.lang.String connectionName) Obtain a child datastore for the given connection name |
|
public Datastore |
getDatastoreForTenantId(java.io.Serializable tenantId) |
|
public int |
getDefaultFlushMode()
|
|
public java.lang.String |
getDefaultFlushModeName()
|
|
public AbstractHibernateEventListener |
getEventTriggeringInterceptor() |
|
public abstract IHibernateTemplate |
getHibernateTemplate(int flushMode) Obtains a hibernate template for the given flush mode |
|
public IHibernateTemplate |
getHibernateTemplate() |
|
public MultiTenancyMode |
getMultiTenancyMode() |
|
public org.hibernate.SessionFactory |
getSessionFactory()
|
|
public TenantResolver |
getTenantResolver() |
|
public boolean |
isAutoFlush() |
|
public boolean |
isCacheQueries() |
|
public boolean |
isFailOnError() |
|
public boolean |
isOsivReadOnly() |
|
public boolean |
isPassReadOnlyToHibernate() |
|
public abstract org.hibernate.Session |
openSession()
|
<T> |
protected groovy.lang.Closure<T> |
prepareMultiTenantClosure(groovy.lang.Closure<T> callable) |
|
public java.io.Serializable |
resolveTenantIdentifier() |
|
public java.lang.Iterable<java.io.Serializable> |
resolveTenantIds() |
|
public void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
|
public abstract void |
withFlushMode(org.hibernate.FlushMode flushMode, java.util.concurrent.Callable<java.lang.Boolean> callable) Execute the given operation with the given flush mode |
<T> |
public T |
withNewSession(groovy.lang.Closure<T> callable) |
<T1> |
public T1 |
withNewSession(java.io.Serializable tenantId, groovy.lang.Closure<T1> callable) |
<T> |
public T |
withSession(groovy.lang.Closure<T> callable) |
Methods inherited from class | Name |
---|---|
class AbstractDatastore |
connect, connect, connectStateless, createSession, createStatelessSession, destroy, doInSession, getApplicationContext, getApplicationEventPublisher, getCurrentSession, getMappingContext, getService, getServices, hasCurrentSession, initializeConverters, isIndexed, isSchemaless, mapToPropertyResolver, retrieveSession, retrieveSession, setApplicationContext, withSession |
Disable the tenant id filter for the given datastore and entity
Enable the tenant id filter for the given datastore and entity
Obtain a child datastore for the given connection name
connectionName
- The name of the connection
Obtains a hibernate template for the given flush mode
flushMode
- The flush mode
Execute the given operation with the given flush mode
callable
- The callable