public class HibernateDatastore extends AbstractHibernateDatastore implements org.springframework.context.MessageSourceAware
Datastore implementation that uses a Hibernate SessionFactory underneath.
Modifiers | Name | Description |
---|---|---|
protected java.util.Map<java.lang.String, HibernateDatastore> |
datastoresByConnectionSource |
|
protected ConfigurableApplicationEventPublisher |
eventPublisher |
|
protected HibernateGormEnhancer |
gormEnhancer |
|
protected org.hibernate.boot.Metadata |
metadata |
|
protected GrailsHibernateTransactionManager |
transactionManager |
Constructor and description |
---|
HibernateDatastore
(ConnectionSources<org.hibernate.SessionFactory, HibernateConnectionSourceSettings> connectionSources, HibernateMappingContext mappingContext, ConfigurableApplicationEventPublisher eventPublisher) Create a new HibernateDatastore for the given connection sources and mapping context |
HibernateDatastore
(org.springframework.core.env.PropertyResolver configuration, HibernateConnectionSourceFactory connectionSourceFactory, ConfigurableApplicationEventPublisher eventPublisher) Create a new HibernateDatastore for the given connection sources and mapping context |
HibernateDatastore
(org.springframework.core.env.PropertyResolver configuration, HibernateConnectionSourceFactory connectionSourceFactory) Create a new HibernateDatastore for the given connection sources and mapping context |
HibernateDatastore
(org.springframework.core.env.PropertyResolver configuration, ConfigurableApplicationEventPublisher eventPublisher, java.lang.Class classes) Create a new HibernateDatastore for the given connection sources and mapping context |
HibernateDatastore
(javax.sql.DataSource dataSource, org.springframework.core.env.PropertyResolver configuration, ConfigurableApplicationEventPublisher eventPublisher, java.lang.Class classes) Create a new HibernateDatastore for the given connection sources and mapping context |
HibernateDatastore
(org.springframework.core.env.PropertyResolver configuration, ConfigurableApplicationEventPublisher eventPublisher, java.lang.Package packagesToScan) Construct a Hibernate datastore scanning the given packages |
HibernateDatastore
(javax.sql.DataSource dataSource, org.springframework.core.env.PropertyResolver configuration, ConfigurableApplicationEventPublisher eventPublisher, java.lang.Package packagesToScan) Construct a Hibernate datastore scanning the given packages for the given datasource |
HibernateDatastore
(org.springframework.core.env.PropertyResolver configuration, java.lang.Class classes) Create a new HibernateDatastore for the given connection sources and mapping context |
HibernateDatastore
(org.springframework.core.env.PropertyResolver configuration, java.lang.Package packagesToScan) Construct a Hibernate datastore scanning the given packages |
HibernateDatastore
(java.util.Map<java.lang.String, java.lang.Object> configuration, java.lang.Class classes) Constructor used purely for testing purposes. |
HibernateDatastore
(java.util.Map<java.lang.String, java.lang.Object> configuration, java.lang.Package packagesToScan) Construct a Hibernate datastore scanning the given packages |
HibernateDatastore
(java.lang.Class classes) Constructor used purely for testing purposes. |
HibernateDatastore
(java.lang.Package packagesToScan) Construct a Hibernate datastore scanning the given packages |
HibernateDatastore
(java.lang.Package packageToScan) Construct a Hibernate datastore scanning the given packages |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addTenantForSchema(java.lang.String schemaName) |
|
public java.util.List<java.lang.String> |
allQualifiers(Datastore datastore, PersistentEntity entity) |
|
protected void |
configureValidatorRegistry(HibernateConnectionSourceSettings settings, HibernateMappingContext mappingContext) |
|
protected void |
configureValidatorRegistry(HibernateConnectionSourceSettings settings, HibernateMappingContext mappingContext, ValidatorRegistry validatorRegistry, org.springframework.context.MessageSource messageSource) |
|
public ConnectionSource<javax.sql.DataSource, DataSourceSettings> |
create(java.lang.String name, DataSourceSettings settings) |
|
protected Session |
createSession(org.springframework.core.env.PropertyResolver connectionDetails) |
|
public void |
destroy() |
|
public org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
|
public java.sql.Connection |
getConnection() |
|
public java.sql.Connection |
getConnection(java.lang.String username, java.lang.String password) |
|
public Session |
getCurrentSession() |
|
public HibernateDatastore |
getDatastoreForConnection(java.lang.String connectionName) |
|
public HibernateDatastore |
getDatastoreForConnection(java.lang.String connectionName) Obtain a child HibernateDatastore by connection name |
|
public IHibernateTemplate |
getHibernateTemplate(int flushMode) |
|
public HibernateMappingContext |
getMappingContext() |
|
public org.hibernate.boot.Metadata |
getMetadata() |
|
public GrailsHibernateTransactionManager |
getTransactionManager()
|
|
public boolean |
hasCurrentSession() |
|
protected HibernateGormEnhancer |
initialize() |
|
protected HibernateGormEnhancer |
initialize() |
|
protected HibernateGormEnhancer |
initialize() |
|
public org.hibernate.Session |
openSession() |
|
public void |
persistentEntityAdded(PersistentEntity entity) |
|
protected void |
registerAllEntitiesWithEnhancer() |
|
protected void |
registerEventListeners(ConfigurableApplicationEventPublisher eventPublisher) |
|
public void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
|
public void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
|
public java.lang.String |
toString() |
|
public void |
withFlushMode(org.hibernate.FlushMode flushMode, java.util.concurrent.Callable<java.lang.Boolean> callable) |
Create a new HibernateDatastore for the given connection sources and mapping context
connectionSources
- The ConnectionSources instancemappingContext
- The MappingContext instanceeventPublisher
- The ConfigurableApplicationEventPublisher instanceCreate a new HibernateDatastore for the given connection sources and mapping context
configuration
- The configurationconnectionSourceFactory
- The HibernateConnectionSourceFactory instanceeventPublisher
- The ConfigurableApplicationEventPublisher instanceCreate a new HibernateDatastore for the given connection sources and mapping context
configuration
- The configurationconnectionSourceFactory
- The HibernateConnectionSourceFactory instanceCreate a new HibernateDatastore for the given connection sources and mapping context
configuration
- The configurationeventPublisher
- The ConfigurableApplicationEventPublisher instanceclasses
- The persistent classesCreate a new HibernateDatastore for the given connection sources and mapping context
configuration
- The configurationeventPublisher
- The ConfigurableApplicationEventPublisher instanceclasses
- The persistent classesConstruct a Hibernate datastore scanning the given packages
configuration
- The configurationeventPublisher
- The event publisherpackagesToScan
- The packages to scanConstruct a Hibernate datastore scanning the given packages for the given datasource
configuration
- The configurationeventPublisher
- The event publisherpackagesToScan
- The packages to scanCreate a new HibernateDatastore for the given connection sources and mapping context
configuration
- The configurationclasses
- The persistent classesConstruct a Hibernate datastore scanning the given packages
configuration
- The configurationpackagesToScan
- The packages to scanConstructor used purely for testing purposes. Creates a datastore with an in-memory database and dbCreate set to 'create-drop'
classes
- The classesConstruct a Hibernate datastore scanning the given packages
configuration
- The configurationpackagesToScan
- The packages to scanConstructor used purely for testing purposes. Creates a datastore with an in-memory database and dbCreate set to 'create-drop'
classes
- The classesConstruct a Hibernate datastore scanning the given packages
packagesToScan
- The packages to scanConstruct a Hibernate datastore scanning the given packages
packageToScan
- The package to scanObtain a child HibernateDatastore by connection name
connectionName
- The connection name