Class JPAPropertiesPersistenceUnitPostProcessor
java.lang.Object
org.broadleafcommerce.common.extensibility.jpa.JPAPropertiesPersistenceUnitPostProcessor
- All Implemented Interfaces:
org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor
public class JPAPropertiesPersistenceUnitPostProcessor
extends Object
implements org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor
This class allows us to override Persistence Unit properties on a per-environment basis. Spring's
PersistenceUnitManager allows us to pass in a list of PersistenceUnitPostProcessors. This class will allow us to override
or add custom JPA properties to the Persistence Unit. This is useful when different environments have different requirements
for JPA properties. The best example of this is SQL Dialect. You may want to use a dialect such as Oracle for production
and test environments, and perhaps HSQLDB for local and integration testing. You can set the dialect property using
Spring profiles and properties. The keys will be the same in each environment, but the values would be defined in the
environment-specific properties files. If you want the property to be added only to certain environments,
add the value "null" to the properties file. For example:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected String
protected CompositeAutoImportSql
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
postProcessPersistenceUnitInfo
(org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo pui) void
setPersistenceUnitProperties
(Map<String, String> properties)
-
Field Details
-
persistenceUnitProperties
-
overrideProperties
-
compositeAutoImportSql
-
blPUHibernateHbm2ddlAuto
-
blPUHibernateDialect
-
blPUHibernateShow_sql
-
blPUHibernateCacheUse_second_level_cache
@Value("${blPU.hibernate.cache.use_second_level_cache}") protected String blPUHibernateCacheUse_second_level_cache -
blPUHibernateCacheUse_query_cache
@Value("${blPU.hibernate.cache.use_query_cache}") protected String blPUHibernateCacheUse_query_cache -
blPUHibernateHbm2ddlImport_files
-
blPUHibernateHbm2ddlImport_files_sql_extractor
@Value("${blPU.hibernate.hbm2ddl.import_files_sql_extractor}") protected String blPUHibernateHbm2ddlImport_files_sql_extractor -
blPUHibernateNamingImplicitStrategy
@Value("${blPU.hibernate.implicit_naming_strategy}") protected String blPUHibernateNamingImplicitStrategy -
blPUHibernateNamingPhysicalStrategy
@Value("${blPU.hibernate.physical_naming_strategy}") protected String blPUHibernateNamingPhysicalStrategy -
blCMSStorageHibernateHbm2ddlAuto
-
blCMSStorageHibernateDialect
-
blCMSStorageHibernateShow_sql
-
blCMSStorageHibernateCacheUse_second_level_cache
@Value("${blCMSStorage.hibernate.cache.use_second_level_cache}") protected String blCMSStorageHibernateCacheUse_second_level_cache -
blCMSStorageHibernateCacheUse_query_cache
@Value("${blCMSStorage.hibernate.cache.use_query_cache}") protected String blCMSStorageHibernateCacheUse_query_cache -
blCMSStorageHibernateHbm2ddlImport_files
@Value("${blCMSStorage.hibernate.hbm2ddl.import_files}") protected String blCMSStorageHibernateHbm2ddlImport_files -
blCMSStorageHibernateHbm2ddlImport_files_sql_extractor
@Value("${blCMSStorage.hibernate.hbm2ddl.import_files_sql_extractor}") protected String blCMSStorageHibernateHbm2ddlImport_files_sql_extractor -
blCMSStorageHibernateNamingImplicitStrategy
@Value("${blCMSStorage.hibernate.implicit_naming_strategy}") protected String blCMSStorageHibernateNamingImplicitStrategy -
blCMSStorageHibernateNamingPhysicalStrategy
@Value("${blCMSStorage.hibernate.physical_naming_strategy}") protected String blCMSStorageHibernateNamingPhysicalStrategy -
blSecurePUHibernateHbm2ddlAuto
-
blSecurePUHibernateDialect
-
blSecurePUHibernateShow_sql
-
blSecurePUHibernateCacheUse_second_level_cache
@Value("${blSecurePU.hibernate.cache.use_second_level_cache}") protected String blSecurePUHibernateCacheUse_second_level_cache -
blSecurePUHibernateCacheUse_query_cache
@Value("${blSecurePU.hibernate.cache.use_query_cache}") protected String blSecurePUHibernateCacheUse_query_cache -
blSecurePUHibernateHbm2ddlImport_files
@Value("${blSecurePU.hibernate.hbm2ddl.import_files}") protected String blSecurePUHibernateHbm2ddlImport_files -
blSecurePUHibernateHbm2ddlImport_files_sql_extractor
@Value("${blSecurePU.hibernate.hbm2ddl.import_files_sql_extractor}") protected String blSecurePUHibernateHbm2ddlImport_files_sql_extractor -
blSecurePUHibernateNamingImplicitStrategy
@Value("${blSecurePU.hibernate.implicit_naming_strategy}") protected String blSecurePUHibernateNamingImplicitStrategy -
blSecurePUHibernateNamingPhysicalStrategy
@Value("${blSecurePU.hibernate.physical_naming_strategy}") protected String blSecurePUHibernateNamingPhysicalStrategy
-
-
Constructor Details
-
JPAPropertiesPersistenceUnitPostProcessor
public JPAPropertiesPersistenceUnitPostProcessor()
-
-
Method Details
-
populatePresetProperties
@PostConstruct public void populatePresetProperties() -
postProcessPersistenceUnitInfo
public void postProcessPersistenceUnitInfo(org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo pui) - Specified by:
postProcessPersistenceUnitInfo
in interfaceorg.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor
-
setPersistenceUnitProperties
-