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.
  • Field Details

  • Constructor Details

    • PersistenceUnitInfoImpl

      public PersistenceUnitInfoImpl()
  • Method Details

    • getClassLoader

      public ClassLoader getClassLoader()
      Specified by:
      getClassLoader in interface jakarta.persistence.spi.PersistenceUnitInfo
    • getNewTempClassLoader

      public ClassLoader getNewTempClassLoader()
      Specified by:
      getNewTempClassLoader in interface jakarta.persistence.spi.PersistenceUnitInfo
    • getPersistenceUnitName

      public String getPersistenceUnitName()
      Specified by:
      getPersistenceUnitName in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setPersistenceUnitName

      public void setPersistenceUnitName(String emName)
    • getPersistenceProviderClassName

      public String getPersistenceProviderClassName()
      Specified by:
      getPersistenceProviderClassName in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setPersistenceProviderClassName

      public void setPersistenceProviderClassName(String providerClassName)
    • getTransactionType

      public jakarta.persistence.spi.PersistenceUnitTransactionType getTransactionType()
      Specified by:
      getTransactionType in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setTransactionType

      public void setTransactionType(jakarta.persistence.spi.PersistenceUnitTransactionType transType)
    • getJtaDataSourceName

      public String getJtaDataSourceName()
    • setJtaDataSourceName

      public void setJtaDataSourceName(String jta)
    • getJtaDataSource

      public DataSource getJtaDataSource()
      Specified by:
      getJtaDataSource in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setJtaDataSource

      public void setJtaDataSource(DataSource ds)
    • getNonJtaDataSourceName

      public String getNonJtaDataSourceName()
    • setNonJtaDataSourceName

      public void setNonJtaDataSourceName(String nonJta)
    • getNonJtaDataSource

      public DataSource getNonJtaDataSource()
      Specified by:
      getNonJtaDataSource in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setNonJtaDataSource

      public void setNonJtaDataSource(DataSource ds)
    • getPersistenceUnitRootUrl

      public URL getPersistenceUnitRootUrl()
      Specified by:
      getPersistenceUnitRootUrl in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setPersistenceUnitRootUrl

      public void setPersistenceUnitRootUrl(URL root)
    • excludeUnlistedClasses

      public boolean excludeUnlistedClasses()
      Specified by:
      excludeUnlistedClasses in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setExcludeUnlistedClasses

      public void setExcludeUnlistedClasses(boolean excludeUnlisted)
    • getMappingFileNames

      public List<String> getMappingFileNames()
      Specified by:
      getMappingFileNames in interface jakarta.persistence.spi.PersistenceUnitInfo
    • addMappingFileName

      public void addMappingFileName(String name)
    • getJarFileUrls

      public List<URL> getJarFileUrls()
      Specified by:
      getJarFileUrls in interface jakarta.persistence.spi.PersistenceUnitInfo
    • addJarFile

      public void addJarFile(URL jar)
    • addJarFileName

      public void addJarFileName(String name)
    • processJarFileNames

      public void processJarFileNames()
      Process jar-file elements. An IllegalArgumentException may be thrown if the jar file does not exist in the classpath.
    • validateJarFileName

      public void validateJarFileName(String name)
    • getManagedClassNames

      public List<String> getManagedClassNames()
      Specified by:
      getManagedClassNames in interface jakarta.persistence.spi.PersistenceUnitInfo
    • addManagedClassName

      public void addManagedClassName(String name)
    • getProperties

      public Properties getProperties()
      Specified by:
      getProperties in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setProperty

      public void setProperty(String key, String value)
    • addTransformer

      public void addTransformer(jakarta.persistence.spi.ClassTransformer transformer)
      Specified by:
      addTransformer in interface jakarta.persistence.spi.PersistenceUnitInfo
    • getPersistenceXmlFileUrl

      public URL getPersistenceXmlFileUrl()
      The location of the persistence.xml resource. May be null.
    • setPersistenceXmlFileUrl

      public void setPersistenceXmlFileUrl(URL url)
      The location of the persistence.xml resource. May be null.
    • fromUserProperties

      public void fromUserProperties(Map map)
      Load the given user-supplied map of properties into this persistence unit.
    • toOpenJPAProperties

      public Map toOpenJPAProperties()
      Return a Map containing the properties necessary to create a Configuration that reflects the information in this persistence unit info.
    • toOpenJPAProperties

      public static Map toOpenJPAProperties(jakarta.persistence.spi.PersistenceUnitInfo info)
      Return a Map containing the properties necessary to create a Configuration that reflects the information in the given persistence unit info.
    • getSourceFile

      public File getSourceFile()
      Description copied from interface: SourceTracker
      Return the file from which this instance was parsed.
      Specified by:
      getSourceFile in interface SourceTracker
    • getSourceScope

      public Object getSourceScope()
      Description copied from interface: SourceTracker
      Return the domain-dependent scope of this instance within its file.
      Specified by:
      getSourceScope in interface SourceTracker
    • getSourceType

      public int getSourceType()
      Description copied from interface: SourceTracker
      Return the type of source.
      Specified by:
      getSourceType in interface SourceTracker
    • getLineNumber

      public int getLineNumber()
      Description copied from interface: SourceTracker
      Return the line number of the file at which this instance was parsed.
      Specified by:
      getLineNumber in interface SourceTracker
    • getColNumber

      public int getColNumber()
      Description copied from interface: SourceTracker
      Return the column number in the line of the file at which this instance was parsed.
      Specified by:
      getColNumber in interface SourceTracker
    • getResourceName

      public String getResourceName()
      Description copied from interface: SourceTracker
      Return 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:
      getResourceName in interface SourceTracker
    • getPersistenceXMLSchemaVersion

      public String getPersistenceXMLSchemaVersion()
      Specified by:
      getPersistenceXMLSchemaVersion in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setPersistenceXMLSchemaVersion

      public void setPersistenceXMLSchemaVersion(String version)
    • getValidationMode

      public jakarta.persistence.ValidationMode getValidationMode()
      Specified by:
      getValidationMode in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setValidationMode

      public void setValidationMode(jakarta.persistence.ValidationMode mode)
    • getSharedCacheMode

      public jakarta.persistence.SharedCacheMode getSharedCacheMode()
      Specified by:
      getSharedCacheMode in interface jakarta.persistence.spi.PersistenceUnitInfo
    • setSharedCacheMode

      public void setSharedCacheMode(jakarta.persistence.SharedCacheMode mode)