Class PersistenceUnitInfoImpl
java.lang.Object
org.apache.openjpa.persistence.PersistenceUnitInfoImpl
- All Implemented Interfaces:
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 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) voidaddQualifierAnnotationNames(String qualifierAnnotationName) voidaddTransformer(ClassTransformer transformer) static PersistenceUnitInfoImplconvert(PersistenceConfiguration config) Converts the given configuration into a persistence unit info.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.Return the file from which this instance was parsed.Return the domain-dependent scope of this instance within its file.intReturn the type of source.The transaction type as the deprecated SPI enum, as still required byPersistenceUnitInfoin Jakarta Persistence 3.2.voidProcess 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) voidsetScopeAnnotationName(String scopeAnnotationName) voidvoidsetTransactionType(PersistenceUnitTransactionType transType) voidsetTransactionType(PersistenceUnitTransactionType transType) Deprecated.voidReturn aMapcontaining the properties necessary to create aConfigurationthat reflects the information in this persistence unit info.static MapReturn aMapcontaining the properties necessary to create aConfigurationthat reflects the information in the given persistence unit info.toProperties(PersistenceConfiguration config) Returns a copy of the properties of the given configuration, completed with the OpenJPA specific properties derived from it.voidvalidateJarFileName(String name)
-
Field Details
-
PERSISTENCE_VERSION
- See Also:
-
-
Constructor Details
-
PersistenceUnitInfoImpl
public PersistenceUnitInfoImpl()
-
-
Method Details
-
getClassLoader
- Specified by:
getClassLoaderin interfacePersistenceUnitInfo
-
getNewTempClassLoader
- Specified by:
getNewTempClassLoaderin interfacePersistenceUnitInfo
-
getPersistenceUnitName
- Specified by:
getPersistenceUnitNamein interfacePersistenceUnitInfo
-
setPersistenceUnitName
-
getPersistenceProviderClassName
- Specified by:
getPersistenceProviderClassNamein interfacePersistenceUnitInfo
-
setPersistenceProviderClassName
-
getTransactionType
The transaction type as the deprecated SPI enum, as still required byPersistenceUnitInfoin Jakarta Persistence 3.2.- Specified by:
getTransactionTypein interfacePersistenceUnitInfo
-
setTransactionType
-
setTransactionType
Deprecated. -
getJtaDataSourceName
-
setJtaDataSourceName
-
getJtaDataSource
- Specified by:
getJtaDataSourcein interfacePersistenceUnitInfo
-
setJtaDataSource
-
getNonJtaDataSourceName
-
setNonJtaDataSourceName
-
getNonJtaDataSource
- Specified by:
getNonJtaDataSourcein interfacePersistenceUnitInfo
-
setNonJtaDataSource
-
getPersistenceUnitRootUrl
- Specified by:
getPersistenceUnitRootUrlin interfacePersistenceUnitInfo
-
setPersistenceUnitRootUrl
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()- Specified by:
excludeUnlistedClassesin interfacePersistenceUnitInfo
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean excludeUnlisted) -
getMappingFileNames
- Specified by:
getMappingFileNamesin interfacePersistenceUnitInfo
-
addMappingFileName
-
getJarFileUrls
- Specified by:
getJarFileUrlsin interfacePersistenceUnitInfo
-
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 interfacePersistenceUnitInfo
-
addManagedClassName
-
getProperties
- Specified by:
getPropertiesin interfacePersistenceUnitInfo
-
setProperty
-
addTransformer
- Specified by:
addTransformerin interfacePersistenceUnitInfo
-
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 interfacePersistenceUnitInfo
-
setPersistenceXMLSchemaVersion
-
getValidationMode
- Specified by:
getValidationModein interfacePersistenceUnitInfo
-
setValidationMode
-
setScopeAnnotationName
-
getScopeAnnotationName
- Specified by:
getScopeAnnotationNamein interfacePersistenceUnitInfo
-
addQualifierAnnotationNames
-
getQualifierAnnotationNames
- Specified by:
getQualifierAnnotationNamesin interfacePersistenceUnitInfo
-
convert
Converts the given configuration into a persistence unit info. The given configuration is left untouched; usetoProperties(PersistenceConfiguration)to obtain the matching user properties. -
toProperties
Returns a copy of the properties of the given configuration, completed with the OpenJPA specific properties derived from it. The given configuration is left untouched.
-
setTransactionType(PersistenceUnitTransactionType)