Package org.apache.openjpa.persistence
Class PersistenceUnitInfoImpl
java.lang.Object
org.apache.openjpa.persistence.PersistenceUnitInfoImpl
- All Implemented Interfaces:
jakarta.persistence.spi.PersistenceUnitInfo,SourceTracker
public class PersistenceUnitInfoImpl
extends Object
implements jakarta.persistence.spi.PersistenceUnitInfo, SourceTracker
Implementation of the
PersistenceUnitInfo interface used by OpenJPA
when parsing persistence configuration information.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSimple class resolver built around the persistence unit loader. -
Field Summary
FieldsFields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJarFile(URL jar) voidaddJarFileName(String name) voidaddManagedClassName(String name) voidaddMappingFileName(String name) voidaddTransformer(jakarta.persistence.spi.ClassTransformer transformer) booleanvoidfromUserProperties(Map map) Load the given user-supplied map of properties into this persistence unit.intReturn the column number in the line of the file at which this instance was parsed.intReturn the line number of the file at which this instance was parsed.The location of the persistence.xml resource.Return the domain-meaningful name of the resource that was loaded from this source.jakarta.persistence.SharedCacheModeReturn the file from which this instance was parsed.Return the domain-dependent scope of this instance within its file.intReturn the type of source.jakarta.persistence.spi.PersistenceUnitTransactionTypejakarta.persistence.ValidationModevoidProcess jar-file elements.voidsetExcludeUnlistedClasses(boolean excludeUnlisted) voidvoidvoidvoidsetNonJtaDataSourceName(String nonJta) voidsetPersistenceProviderClassName(String providerClassName) voidsetPersistenceUnitName(String emName) voidsetPersistenceUnitRootUrl(URL root) voidThe location of the persistence.xml resource.voidsetPersistenceXMLSchemaVersion(String version) voidsetProperty(String key, String value) voidsetSharedCacheMode(jakarta.persistence.SharedCacheMode mode) voidsetTransactionType(jakarta.persistence.spi.PersistenceUnitTransactionType transType) voidsetValidationMode(jakarta.persistence.ValidationMode mode) Return aMapcontaining the properties necessary to create aConfigurationthat reflects the information in this persistence unit info.static MaptoOpenJPAProperties(jakarta.persistence.spi.PersistenceUnitInfo info) Return aMapcontaining the properties necessary to create aConfigurationthat reflects the information in the given persistence unit info.voidvalidateJarFileName(String name)
-
Field Details
-
PERSISTENCE_VERSION
- See Also:
-
-
Constructor Details
-
PersistenceUnitInfoImpl
public PersistenceUnitInfoImpl()
-
-
Method Details
-
getClassLoader
- Specified by:
getClassLoaderin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
getNewTempClassLoader
- Specified by:
getNewTempClassLoaderin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
getPersistenceUnitName
- Specified by:
getPersistenceUnitNamein interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setPersistenceUnitName
-
getPersistenceProviderClassName
- Specified by:
getPersistenceProviderClassNamein interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setPersistenceProviderClassName
-
getTransactionType
public jakarta.persistence.spi.PersistenceUnitTransactionType getTransactionType()- Specified by:
getTransactionTypein interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setTransactionType
public void setTransactionType(jakarta.persistence.spi.PersistenceUnitTransactionType transType) -
getJtaDataSourceName
-
setJtaDataSourceName
-
getJtaDataSource
- Specified by:
getJtaDataSourcein interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setJtaDataSource
-
getNonJtaDataSourceName
-
setNonJtaDataSourceName
-
getNonJtaDataSource
- Specified by:
getNonJtaDataSourcein interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setNonJtaDataSource
-
getPersistenceUnitRootUrl
- Specified by:
getPersistenceUnitRootUrlin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setPersistenceUnitRootUrl
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()- Specified by:
excludeUnlistedClassesin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean excludeUnlisted) -
getMappingFileNames
- Specified by:
getMappingFileNamesin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
addMappingFileName
-
getJarFileUrls
- Specified by:
getJarFileUrlsin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
addJarFile
-
addJarFileName
-
processJarFileNames
public void processJarFileNames()Process jar-file elements. An IllegalArgumentException may be thrown if the jar file does not exist in the classpath. -
validateJarFileName
-
getManagedClassNames
- Specified by:
getManagedClassNamesin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
addManagedClassName
-
getProperties
- Specified by:
getPropertiesin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setProperty
-
addTransformer
public void addTransformer(jakarta.persistence.spi.ClassTransformer transformer) - Specified by:
addTransformerin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
getPersistenceXmlFileUrl
The location of the persistence.xml resource. May be null. -
setPersistenceXmlFileUrl
The location of the persistence.xml resource. May be null. -
fromUserProperties
Load the given user-supplied map of properties into this persistence unit. -
toOpenJPAProperties
Return aMapcontaining the properties necessary to create aConfigurationthat reflects the information in this persistence unit info. -
toOpenJPAProperties
Return aMapcontaining the properties necessary to create aConfigurationthat reflects the information in the given persistence unit info. -
getSourceFile
Description copied from interface:SourceTrackerReturn the file from which this instance was parsed.- Specified by:
getSourceFilein interfaceSourceTracker
-
getSourceScope
Description copied from interface:SourceTrackerReturn the domain-dependent scope of this instance within its file.- Specified by:
getSourceScopein interfaceSourceTracker
-
getSourceType
public int getSourceType()Description copied from interface:SourceTrackerReturn the type of source.- Specified by:
getSourceTypein interfaceSourceTracker
-
getLineNumber
public int getLineNumber()Description copied from interface:SourceTrackerReturn the line number of the file at which this instance was parsed.- Specified by:
getLineNumberin interfaceSourceTracker
-
getColNumber
public int getColNumber()Description copied from interface:SourceTrackerReturn the column number in the line of the file at which this instance was parsed.- Specified by:
getColNumberin interfaceSourceTracker
-
getResourceName
Description copied from interface:SourceTrackerReturn the domain-meaningful name of the resource that was loaded from this source. I.e., if we had loaded the source for a Java class, this would return the name of the class.- Specified by:
getResourceNamein interfaceSourceTracker
-
getPersistenceXMLSchemaVersion
- Specified by:
getPersistenceXMLSchemaVersionin interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setPersistenceXMLSchemaVersion
-
getValidationMode
public jakarta.persistence.ValidationMode getValidationMode()- Specified by:
getValidationModein interfacejakarta.persistence.spi.PersistenceUnitInfo
-
setValidationMode
public void setValidationMode(jakarta.persistence.ValidationMode mode)
-