public abstract class AbstractHibernateDatastore extends AbstractDatastore implements ApplicationContextAware, Settings, SchemaMultiTenantCapableDatastore, TransactionCapableDatastore, Closeable, MessageSourceAware, MultipleConnectionSourceCapableDatastore
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 String |
CONFIG_PROPERTY_CACHE_QUERIES |
|
static String |
CONFIG_PROPERTY_OSIV_READONLY |
|
static String |
CONFIG_PROPERTY_PASS_READONLY_TO_HIBERNATE |
|
protected AutoTimestampEventListener |
autoTimestampEventListener |
|
protected ConnectionSources<SessionFactory, HibernateConnectionSourceSettings> |
connectionSources |
|
protected String |
dataSourceName |
|
protected int |
defaultFlushMode |
|
protected String |
defaultFlushModeName |
|
protected AbstractHibernateEventListener |
eventTriggeringInterceptor |
|
protected boolean |
failOnError |
|
protected boolean |
isCacheQueries |
|
protected boolean |
markDirty |
|
protected MultiTenancySettings.MultiTenancyMode |
multiTenantMode |
|
protected boolean |
osivReadOnly |
|
protected boolean |
passReadOnlyToHibernate |
|
protected SchemaHandler |
schemaHandler |
|
protected SessionFactory |
sessionFactory |
|
protected TenantResolver |
tenantResolver |
| Constructor and description |
|---|
protected AbstractHibernateDatastore(ConnectionSources<SessionFactory, HibernateConnectionSourceSettings> connectionSources, HibernateMappingContext mappingContext) |
protected AbstractHibernateDatastore(MappingContext mappingContext, SessionFactory sessionFactory, PropertyResolver config, ApplicationContext applicationContext, String dataSourceName) |
AbstractHibernateDatastore(MappingContext mappingContext, SessionFactory sessionFactory, PropertyResolver config) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public T |
call(Object args) |
|
public void |
close() |
|
protected ValidatorRegistry |
createValidatorRegistry(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<SessionFactory, HibernateConnectionSourceSettings> |
getConnectionSources() |
|
public javax.sql.DataSource |
getDataSource()
|
|
public String |
getDataSourceName()
|
|
public abstract AbstractHibernateDatastore |
getDatastoreForConnection(String connectionName)Obtain a child datastore for the given connection name |
|
public Datastore |
getDatastoreForTenantId(Serializable tenantId) |
|
public int |
getDefaultFlushMode()
|
|
public String |
getDefaultFlushModeName()
|
|
public AbstractHibernateEventListener |
getEventTriggeringInterceptor() |
|
public abstract IHibernateTemplate |
getHibernateTemplate(int flushMode)Obtains a hibernate template for the given flush mode |
|
public IHibernateTemplate |
getHibernateTemplate() |
|
public MultiTenancySettings.MultiTenancyMode |
getMultiTenancyMode() |
|
public SessionFactory |
getSessionFactory()
|
|
public TenantResolver |
getTenantResolver() |
|
public boolean |
isAutoFlush() |
|
public boolean |
isCacheQueries() |
|
public boolean |
isFailOnError() |
|
public boolean |
isOsivReadOnly() |
|
public boolean |
isPassReadOnlyToHibernate() |
|
public abstract Session |
openSession()
|
<T> |
protected Closure<T> |
prepareMultiTenantClosure(Closure<T> callable) |
|
public Serializable |
resolveTenantIdentifier() |
|
public Iterable<Serializable> |
resolveTenantIds() |
|
public void |
setMessageSource(MessageSource messageSource) |
|
public abstract void |
withFlushMode(AbstractHibernateDatastore.FlushMode flushMode, Callable<Boolean> callable)Execute the given operation with the given flush mode |
<T> |
public T |
withNewSession(Closure<T> callable) |
<T1> |
public T1 |
withNewSession(Serializable tenantId, Closure<T1> callable) |
<T> |
public T |
withSession(Closure<T> callable) |
| Methods inherited from class | Name |
|---|---|
class AbstractDatastore |
connect, connect, connectStateless, destroy, equals, getApplicationContext, getApplicationEventPublisher, getClass, getCurrentSession, getMappingContext, getService, getServices, hasCurrentSession, hashCode, isSchemaless, notify, notifyAll, retrieveSession, retrieveSession, setApplicationContext, toString, wait, wait, wait, 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