public class DefaultPersistenceProvider
extends org.hibernate.ejb.HibernatePersistence
implements org.springframework.context.ApplicationContextAware
EntityManager
instances and associated objects are proxied. The proxies make sure relevant functionality is included in EntityManager
operations and results (such as sandbox and multitenant behavior).Modifier and Type | Field and Description |
---|---|
protected static org.springframework.context.ApplicationContext |
applicationContext |
protected List<EntityManagerInvocationProvider> |
invocationProviders |
ALIAS_SPECIFIC_LOCK_MODE, AUTODETECTION, CFG_FILE, CLASS_CACHE_PREFIX, CLASS_NAMES, COLLECTION_CACHE_PREFIX, CONFIGURATION_JNDI_NAME, DISCARD_PC_ON_CLOSE, ENTITY_MANAGER_FACTORY_NAME, EVENT_LISTENER_PREFIX, FLUSH_MODE, HBXML_FILES, IDENTIFIER_GENERATOR_STRATEGY_PROVIDER, INTERCEPTOR, JACC_CONTEXT_ID, JACC_ENABLED, JACC_PREFIX, JDBC_DRIVER, JDBC_PASSWORD, JDBC_URL, JDBC_USER, JPA_METAMODEL_GENERATION, JPA_METAMODEL_POPULATION, JTA_DATASOURCE, LOADED_CLASSES, LOCK_SCOPE, LOCK_TIMEOUT, NAMING_STRATEGY, NON_JTA_DATASOURCE, PACKAGE_NAMES, PERSIST_VALIDATION_GROUP, PERSISTENCE_UNIT_NAME, PROVIDER, REMOVE_VALIDATION_GROUP, SCANNER, SESSION_FACTORY_OBSERVER, SESSION_INTERCEPTOR, SHARED_CACHE_MODE, SHARED_CACHE_RETRIEVE_MODE, SHARED_CACHE_STORE_MODE, TRANSACTION_TYPE, UPDATE_VALIDATION_GROUP, USE_CLASS_ENHANCER, VALIDATION_FACTORY, VALIDATION_MODE, XML_FILE_NAMES
Constructor and Description |
---|
DefaultPersistenceProvider() |
Modifier and Type | Method and Description |
---|---|
static FilterCheck |
checkFilterState(javax.persistence.EntityManager em)
Based on the current
BroadleafRequestContext state,
enable or disable various Hibernate filters via EntityManagerInvocationProvider |
static FilterCheck |
checkFilterState(org.hibernate.Session session) |
javax.persistence.EntityManagerFactory |
createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo info,
Map properties) |
javax.persistence.EntityManagerFactory |
createEntityManagerFactory(Map properties) |
javax.persistence.EntityManagerFactory |
createEntityManagerFactory(String persistenceUnitName,
Map properties) |
protected void |
getAllInterfaces(Class<?> clazz,
List<Class<?>> interfaces) |
protected javax.persistence.EntityManagerFactory |
getEntityManagerFactory(javax.persistence.EntityManagerFactory factory)
Insert
EntityManagerInvocationProvider instances
into proxied EntityManager, and associated object proxies. |
protected Class<?>[] |
getInterfaces(Class<?> clazz) |
List<EntityManagerInvocationProvider> |
getInvocationProviders() |
static List<EntityManagerInvocationProvider> |
getStaticInvocationProviders() |
void |
init() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setInvocationProviders(List<EntityManagerInvocationProvider> invocationProviders) |
static void |
sortProviders(List<EntityManagerInvocationProvider> providers) |
static org.hibernate.Session |
unwrapIfNecessary(org.hibernate.Session session) |
protected List<EntityManagerInvocationProvider> invocationProviders
protected static org.springframework.context.ApplicationContext applicationContext
public static org.hibernate.Session unwrapIfNecessary(org.hibernate.Session session)
public static FilterCheck checkFilterState(javax.persistence.EntityManager em)
BroadleafRequestContext
state,
enable or disable various Hibernate filters via EntityManagerInvocationProvider
em
- public static FilterCheck checkFilterState(org.hibernate.Session session)
public static void sortProviders(List<EntityManagerInvocationProvider> providers)
public static List<EntityManagerInvocationProvider> getStaticInvocationProviders()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
@PostConstruct public void init()
public javax.persistence.EntityManagerFactory createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo info, Map properties)
createContainerEntityManagerFactory
in interface javax.persistence.spi.PersistenceProvider
createContainerEntityManagerFactory
in class org.hibernate.ejb.HibernatePersistence
public javax.persistence.EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map properties)
createEntityManagerFactory
in interface javax.persistence.spi.PersistenceProvider
createEntityManagerFactory
in class org.hibernate.ejb.HibernatePersistence
public javax.persistence.EntityManagerFactory createEntityManagerFactory(Map properties)
createEntityManagerFactory
in class org.hibernate.ejb.HibernatePersistence
protected javax.persistence.EntityManagerFactory getEntityManagerFactory(javax.persistence.EntityManagerFactory factory)
EntityManagerInvocationProvider
instances
into proxied EntityManager, and associated object proxies. The invocation provides make sure any special behavior
required by the module is executed during the EntityManager related call.factory
- create of EntityManager instancespublic List<EntityManagerInvocationProvider> getInvocationProviders()
public void setInvocationProviders(List<EntityManagerInvocationProvider> invocationProviders)
Copyright © 2017. All rights reserved.