接口 EntityManagerFactoryInfo
- 所有已知实现类:
AbstractEntityManagerFactoryBean,LocalContainerEntityManagerFactoryBean,LocalEntityManagerFactoryBean
public interface EntityManagerFactoryInfo
Metadata interface for a Spring-managed JPAEntityManagerFactory.This facility can be obtained from Spring-managed EntityManagerFactory proxies through casting the EntityManagerFactory handle to this interface.
- 从以下版本开始:
- 2.0
- 作者:
- Rod Johnson, Juergen Hoeller
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ClassLoadergetBeanClassLoader()Return the ClassLoader that the application's beans are loaded with.DataSourcegetDataSource()Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.Class<? extends EntityManager>getEntityManagerInterface()Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.JpaDialectgetJpaDialect()Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, ornullif not known.EntityManagerFactorygetNativeEntityManagerFactory()Return the raw underlying EntityManagerFactory.PersistenceProvidergetPersistenceProvider()Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.PersistenceUnitInfogetPersistenceUnitInfo()Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.StringgetPersistenceUnitName()Return the name of the persistence unit used to create this EntityManagerFactory, ornullif it is an unnamed default.
方法详细资料
getNativeEntityManagerFactory
EntityManagerFactory getNativeEntityManagerFactory()
Return the raw underlying EntityManagerFactory.- 返回:
- the unadorned EntityManagerFactory (never
null)
getPersistenceProvider
PersistenceProvider getPersistenceProvider()
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.- 返回:
- the PersistenceProvider used to create this EntityManagerFactory, or
nullif the standard JPA provider autodetection process was used to configure the EntityManagerFactory
getPersistenceUnitInfo
PersistenceUnitInfo getPersistenceUnitInfo()
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.- 返回:
- the PersistenceUnitInfo used to create this EntityManagerFactory, or
nullif the in-container contract was not used to configure the EntityManagerFactory
getPersistenceUnitName
String getPersistenceUnitName()
Return the name of the persistence unit used to create this EntityManagerFactory, ornullif it is an unnamed default.If
getPersistenceUnitInfo()returns non-null, the result ofgetPersistenceUnitName()must be equal to the value returned byPersistenceUnitInfo.getPersistenceUnitName().
getDataSource
DataSource getDataSource()
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.- 返回:
- the JDBC DataSource, or
nullif not known
getEntityManagerInterface
Class<? extends EntityManager> getEntityManagerInterface()
Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.A
nullreturn value suggests that autodetection is supposed to happen: either based on a targetEntityManagerinstance or simply defaulting tojavax.persistence.EntityManager.
getJpaDialect
JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, ornullif not known.
getBeanClassLoader
ClassLoader getBeanClassLoader()
Return the ClassLoader that the application's beans are loaded with.Proxies will be generated in this ClassLoader.