Package org.springframework.orm.jpa
Interface EntityManagerFactoryInfo
- All Known Implementing Classes:
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.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassLoader
getBeanClassLoader()
Return the ClassLoader that the application's beans are loaded with.DataSource
getDataSource()
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.JpaDialect
getJpaDialect()
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, ornull
if not known.EntityManagerFactory
getNativeEntityManagerFactory()
Return the raw underlying EntityManagerFactory.PersistenceProvider
getPersistenceProvider()
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.PersistenceUnitInfo
getPersistenceUnitInfo()
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.String
getPersistenceUnitName()
Return the name of the persistence unit used to create this EntityManagerFactory, ornull
if it is an unnamed default.
Method Detail
getNativeEntityManagerFactory
EntityManagerFactory getNativeEntityManagerFactory()
Return the raw underlying EntityManagerFactory.- Returns:
- the unadorned EntityManagerFactory (never
null
)
getPersistenceProvider
@Nullable PersistenceProvider getPersistenceProvider()
Return the underlying PersistenceProvider that the underlying EntityManagerFactory was created with.- Returns:
- the PersistenceProvider used to create this EntityManagerFactory, or
null
if the standard JPA provider autodetection process was used to configure the EntityManagerFactory
getPersistenceUnitInfo
@Nullable PersistenceUnitInfo getPersistenceUnitInfo()
Return the PersistenceUnitInfo used to create this EntityManagerFactory, if the in-container API was used.- Returns:
- the PersistenceUnitInfo used to create this EntityManagerFactory, or
null
if the in-container contract was not used to configure the EntityManagerFactory
getPersistenceUnitName
@Nullable String getPersistenceUnitName()
Return the name of the persistence unit used to create this EntityManagerFactory, ornull
if it is an unnamed default.If
getPersistenceUnitInfo()
returns non-null, the result ofgetPersistenceUnitName()
must be equal to the value returned byPersistenceUnitInfo.getPersistenceUnitName()
.
getDataSource
@Nullable DataSource getDataSource()
Return the JDBC DataSource that this EntityManagerFactory obtains its JDBC Connections from.- Returns:
- the JDBC DataSource, or
null
if not known
getEntityManagerInterface
@Nullable Class<? extends EntityManager> getEntityManagerInterface()
Return the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers will implement.A
null
return value suggests that autodetection is supposed to happen: either based on a targetEntityManager
instance or simply defaulting tojavax.persistence.EntityManager
.
getJpaDialect
@Nullable JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this EntityManagerFactory, ornull
if not known.
getBeanClassLoader
ClassLoader getBeanClassLoader()
Return the ClassLoader that the application's beans are loaded with.Proxies will be generated in this ClassLoader.