Package org.hibernate.jpa.boot.internal
Class ParsedPersistenceXmlDescriptor
- java.lang.Object
-
- org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor
-
- All Implemented Interfaces:
PersistenceUnitDescriptor
public class ParsedPersistenceXmlDescriptor extends Object implements PersistenceUnitDescriptor
Describes the information gleaned from a<persistence-unit/>
element in apersistence.xml
file whether parsed directly by Hibernate or passed to us by an EE container as aPersistenceUnitInfo
. Easier to consolidate both views into a single contract and extract information through that shared contract.
-
-
Constructor Summary
Constructors Constructor Description ParsedPersistenceXmlDescriptor(URL persistenceUnitRootUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClasses(String... classes)
void
addClasses(List<String> classes)
void
addJarFileUrl(URL jarFileUrl)
void
addMappingFiles(String... mappingFiles)
void
addMappingFiles(List<String> mappingFiles)
ClassLoader
getClassLoader()
List<URL>
getJarFileUrls()
Object
getJtaDataSource()
List<String>
getManagedClassNames()
List<String>
getMappingFileNames()
String
getName()
Get the persistence unit name,Object
getNonJtaDataSource()
URL
getPersistenceUnitRootUrl()
Get the root url for the persistence unit.Properties
getProperties()
String
getProviderClassName()
Get the explicitly specified provider class name, ornull
if not specified.jakarta.persistence.SharedCacheMode
getSharedCacheMode()
ClassLoader
getTempClassLoader()
jakarta.persistence.spi.PersistenceUnitTransactionType
getTransactionType()
jakarta.persistence.ValidationMode
getValidationMode()
boolean
isExcludeUnlistedClasses()
Essentially should scanning for classes be performed? If not, the list of classes available is limited to: classes listed inPersistenceUnitDescriptor.getManagedClassNames()
classes named in allPersistenceUnitDescriptor.getMappingFileNames()
classes discovered inPersistenceUnitDescriptor.getJarFileUrls()
boolean
isUseQuotedIdentifiers()
Is the use of quoted identifiers in effect for this whole persistence unit?void
pushClassTransformer(EnhancementContext enhancementContext)
void
setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
void
setJtaDataSource(Object jtaDataSource)
void
setName(String name)
void
setNonJtaDataSource(Object nonJtaDataSource)
void
setProviderClassName(String providerClassName)
void
setSharedCacheMode(String sharedCacheMode)
void
setTransactionType(jakarta.persistence.spi.PersistenceUnitTransactionType transactionType)
void
setUseQuotedIdentifiers(boolean useQuotedIdentifiers)
void
setValidationMode(String validationMode)
-
-
-
Constructor Detail
-
ParsedPersistenceXmlDescriptor
public ParsedPersistenceXmlDescriptor(URL persistenceUnitRootUrl)
-
-
Method Detail
-
getPersistenceUnitRootUrl
public URL getPersistenceUnitRootUrl()
Description copied from interface:PersistenceUnitDescriptor
Get the root url for the persistence unit. Intended to describe the base for scanning.- Specified by:
getPersistenceUnitRootUrl
in interfacePersistenceUnitDescriptor
- Returns:
- The root url
-
getName
public String getName()
Description copied from interface:PersistenceUnitDescriptor
Get the persistence unit name,- Specified by:
getName
in interfacePersistenceUnitDescriptor
- Returns:
- The persistence unit name,
-
setName
public void setName(String name)
-
getNonJtaDataSource
public Object getNonJtaDataSource()
- Specified by:
getNonJtaDataSource
in interfacePersistenceUnitDescriptor
-
setNonJtaDataSource
public void setNonJtaDataSource(Object nonJtaDataSource)
-
getJtaDataSource
public Object getJtaDataSource()
- Specified by:
getJtaDataSource
in interfacePersistenceUnitDescriptor
-
setJtaDataSource
public void setJtaDataSource(Object jtaDataSource)
-
getProviderClassName
public String getProviderClassName()
Description copied from interface:PersistenceUnitDescriptor
Get the explicitly specified provider class name, ornull
if not specified.- Specified by:
getProviderClassName
in interfacePersistenceUnitDescriptor
- Returns:
- The specified provider class name
-
setProviderClassName
public void setProviderClassName(String providerClassName)
-
getTransactionType
public jakarta.persistence.spi.PersistenceUnitTransactionType getTransactionType()
- Specified by:
getTransactionType
in interfacePersistenceUnitDescriptor
-
setTransactionType
public void setTransactionType(jakarta.persistence.spi.PersistenceUnitTransactionType transactionType)
-
isUseQuotedIdentifiers
public boolean isUseQuotedIdentifiers()
Description copied from interface:PersistenceUnitDescriptor
Is the use of quoted identifiers in effect for this whole persistence unit?- Specified by:
isUseQuotedIdentifiers
in interfacePersistenceUnitDescriptor
- Returns:
true
is quoted identifiers should be used throughout the unit.
-
setUseQuotedIdentifiers
public void setUseQuotedIdentifiers(boolean useQuotedIdentifiers)
-
getProperties
public Properties getProperties()
- Specified by:
getProperties
in interfacePersistenceUnitDescriptor
-
isExcludeUnlistedClasses
public boolean isExcludeUnlistedClasses()
Description copied from interface:PersistenceUnitDescriptor
Essentially should scanning for classes be performed? If not, the list of classes available is limited to:- classes listed in
PersistenceUnitDescriptor.getManagedClassNames()
- classes named in all
PersistenceUnitDescriptor.getMappingFileNames()
- classes discovered in
PersistenceUnitDescriptor.getJarFileUrls()
- Specified by:
isExcludeUnlistedClasses
in interfacePersistenceUnitDescriptor
- Returns:
true
if the root url should not be scanned for classes.
- classes listed in
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
-
getValidationMode
public jakarta.persistence.ValidationMode getValidationMode()
- Specified by:
getValidationMode
in interfacePersistenceUnitDescriptor
-
setValidationMode
public void setValidationMode(String validationMode)
-
getSharedCacheMode
public jakarta.persistence.SharedCacheMode getSharedCacheMode()
- Specified by:
getSharedCacheMode
in interfacePersistenceUnitDescriptor
-
setSharedCacheMode
public void setSharedCacheMode(String sharedCacheMode)
-
getManagedClassNames
public List<String> getManagedClassNames()
- Specified by:
getManagedClassNames
in interfacePersistenceUnitDescriptor
-
addClasses
public void addClasses(String... classes)
-
getMappingFileNames
public List<String> getMappingFileNames()
- Specified by:
getMappingFileNames
in interfacePersistenceUnitDescriptor
-
addMappingFiles
public void addMappingFiles(String... mappingFiles)
-
getJarFileUrls
public List<URL> getJarFileUrls()
- Specified by:
getJarFileUrls
in interfacePersistenceUnitDescriptor
-
addJarFileUrl
public void addJarFileUrl(URL jarFileUrl)
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfacePersistenceUnitDescriptor
-
getTempClassLoader
public ClassLoader getTempClassLoader()
- Specified by:
getTempClassLoader
in interfacePersistenceUnitDescriptor
-
pushClassTransformer
public void pushClassTransformer(EnhancementContext enhancementContext)
- Specified by:
pushClassTransformer
in interfacePersistenceUnitDescriptor
-
-