public class HibernateDatastore extends AbstractHibernateDatastore
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 | Name and description |
---|---|
void |
addTenantForSchema(java.lang.String schemaName) |
protected void |
configureValidatorRegistry(HibernateConnectionSourceSettings settings, HibernateMappingContext mappingContext) |
protected void |
configureValidatorRegistry(HibernateConnectionSourceSettings settings, HibernateMappingContext mappingContext, ValidatorRegistry validatorRegistry, org.springframework.context.MessageSource messageSource) |
protected Session |
createSession(org.springframework.core.env.PropertyResolver connectionDetails) |
void |
destroy() |
org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
Session |
getCurrentSession() |
HibernateDatastore |
getDatastoreForConnection(java.lang.String connectionName) Obtain a child HibernateDatastore by connection name |
IHibernateTemplate |
getHibernateTemplate(int flushMode) |
HibernateMappingContext |
getMappingContext() |
org.hibernate.boot.Metadata |
getMetadata() |
GrailsHibernateTransactionManager |
getTransactionManager() @return The org.springframework.transaction.PlatformTransactionManager instance |
boolean |
hasCurrentSession() |
protected HibernateGormEnhancer |
initialize() |
org.hibernate.Session |
openSession() |
protected void |
registerAllEntitiesWithEnhancer() |
protected void |
registerEventListeners(ConfigurableApplicationEventPublisher eventPublisher) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
java.lang.String |
toString() |
void |
withFlushMode(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