public interface PersistenceUnitManager
LocalContainerEntityManagerFactoryBean
in order to obtain a PersistenceUnitInfo
for building a concrete EntityManagerFactory
.
Obtaining a PersistenceUnitInfo instance is an exclusive process. A PersistenceUnitInfo instance is not available for further calls anymore once it has been obtained.
DefaultPersistenceUnitManager
,
LocalContainerEntityManagerFactoryBean.setPersistenceUnitManager(org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager)
Modifier and Type | Method and Description |
---|---|
PersistenceUnitInfo |
obtainDefaultPersistenceUnitInfo()
Obtain the default PersistenceUnitInfo from this manager.
|
PersistenceUnitInfo |
obtainPersistenceUnitInfo(java.lang.String persistenceUnitName)
Obtain the specified PersistenceUnitInfo from this manager.
|
PersistenceUnitInfo obtainDefaultPersistenceUnitInfo() throws java.lang.IllegalStateException
null
)java.lang.IllegalStateException
- if there is no default PersistenceUnitInfo defined
or it has already been obtainedPersistenceUnitInfo obtainPersistenceUnitInfo(java.lang.String persistenceUnitName) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
persistenceUnitName
- the name of the desired persistence unitnull
)java.lang.IllegalArgumentException
- if no PersistenceUnitInfo with the given
name is definedjava.lang.IllegalStateException
- if the PersistenceUnitInfo with the given
name has already been obtained