Class PersistenceUnitInfoImpl

  • All Implemented Interfaces:
    jakarta.persistence.spi.PersistenceUnitInfo, SourceTracker

    public class PersistenceUnitInfoImpl
    extends java.lang.Object
    implements jakarta.persistence.spi.PersistenceUnitInfo, SourceTracker
    Implementation of the PersistenceUnitInfo interface used by OpenJPA when parsing persistence configuration information.
    • Field Detail

      • PERSISTENCE_VERSION

        public static final java.lang.String PERSISTENCE_VERSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • PersistenceUnitInfoImpl

        public PersistenceUnitInfoImpl()
    • Method Detail

      • getClassLoader

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

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

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

        public void setPersistenceUnitName​(java.lang.String emName)
      • getPersistenceProviderClassName

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

        public void setPersistenceProviderClassName​(java.lang.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 java.lang.String getJtaDataSourceName()
      • setJtaDataSourceName

        public void setJtaDataSourceName​(java.lang.String jta)
      • getJtaDataSource

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

        public void setJtaDataSource​(javax.sql.DataSource ds)
      • getNonJtaDataSourceName

        public java.lang.String getNonJtaDataSourceName()
      • setNonJtaDataSourceName

        public void setNonJtaDataSourceName​(java.lang.String nonJta)
      • getNonJtaDataSource

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

        public void setNonJtaDataSource​(javax.sql.DataSource ds)
      • getPersistenceUnitRootUrl

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

        public void setPersistenceUnitRootUrl​(java.net.URL root)
      • excludeUnlistedClasses

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

        public void setExcludeUnlistedClasses​(boolean excludeUnlisted)
      • getMappingFileNames

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

        public void addMappingFileName​(java.lang.String name)
      • getJarFileUrls

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

        public void addJarFile​(java.net.URL jar)
      • addJarFileName

        public void addJarFileName​(java.lang.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​(java.lang.String name)
      • getManagedClassNames

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

        public void addManagedClassName​(java.lang.String name)
      • getProperties

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

        public void setProperty​(java.lang.String key,
                                java.lang.String value)
      • addTransformer

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

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

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

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

        public java.util.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 java.util.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 java.io.File getSourceFile()
        Description copied from interface: SourceTracker
        Return the file from which this instance was parsed.
        Specified by:
        getSourceFile in interface SourceTracker
      • getSourceScope

        public java.lang.Object getSourceScope()
        Description copied from interface: SourceTracker
        Return the domain-dependent scope of this instance within its file.
        Specified by:
        getSourceScope 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 java.lang.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 java.lang.String getPersistenceXMLSchemaVersion()
        Specified by:
        getPersistenceXMLSchemaVersion in interface jakarta.persistence.spi.PersistenceUnitInfo
      • setPersistenceXMLSchemaVersion

        public void setPersistenceXMLSchemaVersion​(java.lang.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)