@Configuration public class PersistenceConfiguration extends Object implements BaseConfiguration
BaseConfiguration.ClusterDisabledCondition, BaseConfiguration.ClusterEnabledCondition, BaseConfiguration.PROPERTY_SOURCE_LOCATIONS
ADDONS_CONFIGURATION_COMPONENT_SCAN_PACKAGE, CLUSTER_ENABLE_PROPERTY_NAME, CONFIGURATION_ORDER_DELTA, CUSTOM_CONFIGURATION_COMPONENT_SCAN_PACKAGE, DEFAULT_WEB_APPLICATION_INITIALIZER_ORDER, ONE_CONFIGURATION_ORDER, PROPERTY_SOURCES_CUSTOM_APPLICATION_CONTEXT_INITIALIZER_ORDER, SECURITY_CONFIGURATION_ORDER, SECURITY_WEB_APPLICATION_INITIALIZER_ORDER, SESSION_WEB_APPLICATION_INITIALIZER_ORDER, VIS_CONFIGURATION_ORDER
Constructor and Description |
---|
PersistenceConfiguration() |
Modifier and Type | Method and Description |
---|---|
DatabaseMetadata |
databaseMetadata(String catalog,
String schema,
String tablePrefix) |
DatabaseSchemaCreationStrategy |
databaseSchemaCreationStrategy() |
StrategyBasedDatabaseSchemaManager |
databaseSchemaManager(DatabaseSchemaCreationStrategy strategy,
DatabaseSchemaService databaseSchemaService)
The
StrategyBasedDatabaseSchemaManager must be instantiated early in the context initialization such that
all database tables are present when other beans like the ProcessEngine gets created. |
DatabaseSchemaService |
databaseSchemaService(DataSource dataSource,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
DatabaseType |
databaseType(DataSource dataSource) |
DataSource |
dataSource(org.springframework.core.env.Environment environment) |
void |
postConstruct() |
org.springframework.transaction.PlatformTransactionManager |
transactionManager(DataSource dataSource,
org.springframework.core.env.Environment environment) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyConfigurationCustomisations, getObjectOrDefault
@PostConstruct public void postConstruct() throws Exception
Exception
@Bean public DatabaseMetadata databaseMetadata(@Value(value="${datasource.catalog:}") String catalog, @Value(value="${datasource.schema-name:#{null}}") String schema, @Value(value="${datasource.table-prefix:}") String tablePrefix)
@Bean public DatabaseSchemaCreationStrategy databaseSchemaCreationStrategy()
@Bean(destroyMethod="drop") public StrategyBasedDatabaseSchemaManager databaseSchemaManager(DatabaseSchemaCreationStrategy strategy, DatabaseSchemaService databaseSchemaService)
The StrategyBasedDatabaseSchemaManager
must be instantiated early in the context initialization such that
all database tables are present when other beans like the ProcessEngine
gets created.
Therefore the method is declared static
such that Spring instantiates it as one of the first beans.
When the DatabaseSchemaCreationStrategy.CREATE_DROP
is used the dropping of the tables is handled in the
{#link StrategyBasedDatabaseSchemaManager.drop()
} method, which is configured as bean destroy method.
@Bean public DatabaseSchemaService databaseSchemaService(DataSource dataSource, org.springframework.transaction.PlatformTransactionManager transactionManager)
@Bean public DatabaseType databaseType(DataSource dataSource)
@Bean public DataSource dataSource(org.springframework.core.env.Environment environment)
@Bean public org.springframework.transaction.PlatformTransactionManager transactionManager(DataSource dataSource, org.springframework.core.env.Environment environment)
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.