java.lang.Object
org.eclipse.persistence.internal.jpa.deployment.SEPersistenceUnitInfo
All Implemented Interfaces:
PersistenceUnitInfo

public class SEPersistenceUnitInfo extends Object implements PersistenceUnitInfo
Internal implementation of the PersistenceUnitInfo detailed in the EJB 3.0 specification Used by our Java SE implementation so common method calls can be used in setting of Container and non-Container EntityManagerFactories.
  • Field Details

    • cacheMode

      protected SharedCacheMode cacheMode
    • validationMode

      protected ValidationMode validationMode
    • persistenceUnitName

      protected String persistenceUnitName
    • persistenceProviderClassName

      protected String persistenceProviderClassName
    • jtaDataSource

      protected DataSource jtaDataSource
    • nonJtaDataSource

      protected DataSource nonJtaDataSource
    • persistenceUnitTransactionType

      protected PersistenceUnitTransactionType persistenceUnitTransactionType
    • mappingFiles

      protected List<String> mappingFiles
    • jarFileUrls

      protected List<URL> jarFileUrls
    • managedClassNames

      protected List<String> managedClassNames
    • persistenceUnitRootUrl

      protected URL persistenceUnitRootUrl
    • excludeUnlistedClasses

      protected boolean excludeUnlistedClasses
    • persistenceUnitProperties

      protected List<SEPersistenceUnitProperty> persistenceUnitProperties
    • properties

      protected Properties properties
    • tempClassLoader

      protected ClassLoader tempClassLoader
    • realClassLoader

      protected ClassLoader realClassLoader
  • Constructor Details

    • SEPersistenceUnitInfo

      public SEPersistenceUnitInfo()
  • Method Details

    • getPersistenceUnitName

      public String getPersistenceUnitName()
      Specified by:
      getPersistenceUnitName in interface PersistenceUnitInfo
      Returns:
      The name of the persistence unit. Corresponds to the <name> element in the persistence.xml file.
    • setPersistenceUnitName

      public void setPersistenceUnitName(String persistenceUnitName)
    • getPersistenceUnitProperties

      public List<SEPersistenceUnitProperty> getPersistenceUnitProperties()
      Used with the OX mapping file for the Canonical model processor.
    • setPersistenceUnitProperties

      public void setPersistenceUnitProperties(List<SEPersistenceUnitProperty> persistenceUnitProperties)
      Used with the OX mapping file for the Canonical model processor.
    • getPersistenceProviderClassName

      public String getPersistenceProviderClassName()
      Specified by:
      getPersistenceProviderClassName in interface PersistenceUnitInfo
      Returns:
      The fully qualified name of the persistence provider implementation class. Corresponds to the <provider> element in the persistence.xml file.
    • setPersistenceProviderClassName

      public void setPersistenceProviderClassName(String persistenceProviderClassName)
    • getTransactionType

      public PersistenceUnitTransactionType getTransactionType()
      Specified by:
      getTransactionType in interface PersistenceUnitInfo
      Returns:
      The transaction type of the entity managers created by the EntityManagerFactory. The transaction type corresponds to the transaction-type attribute in the persistence.xml file.
    • setTransactionType

      public void setTransactionType(PersistenceUnitTransactionType persistenceUnitTransactionType)
    • getJtaDataSource

      public DataSource getJtaDataSource()
      Specified by:
      getJtaDataSource in interface PersistenceUnitInfo
      Returns:
      the JTA-enabled data source to be used by the persistence provider. The data source corresponds to the <jta-data-source> element in the persistence.xml file or is provided at deployment or by the container.
    • setJtaDataSource

      public void setJtaDataSource(DataSource jtaDataSource)
    • getNonJtaDataSource

      public DataSource getNonJtaDataSource()
      Specified by:
      getNonJtaDataSource in interface PersistenceUnitInfo
      Returns:
      The non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. The data source corresponds to the named <non-jta-data-source> element in the persistence.xml file or provided at deployment or by the container.
    • setNonJtaDataSource

      public void setNonJtaDataSource(DataSource nonJtaDataSource)
    • getMappingFileNames

      public List<String> getMappingFileNames()
      Specified by:
      getMappingFileNames in interface PersistenceUnitInfo
      Returns:
      The list of mapping file names that the persistence provider must load to determine the mappings for the entity classes. The mapping files must be in the standard XML mapping format, be uniquely named and be resource-loadable from the application classpath. This list will not include the orm.xml file if one was specified. Each mapping file name corresponds to a <mapping-file> element in the persistence.xml file.
    • setMappingFileNames

      public void setMappingFileNames(List<String> mappingFiles)
    • getJarFileUrls

      public List<URL> getJarFileUrls()
      Specified by:
      getJarFileUrls in interface PersistenceUnitInfo
      Returns:
      The list of JAR file URLs that the persistence provider must examine for managed classes of the persistence unit. Each jar file URL corresponds to a named <jar-file> element in the persistence.xml file.
    • setJarFileUrls

      public void setJarFileUrls(List<URL> jarFileUrls)
    • getPersistenceUnitRootUrl

      public URL getPersistenceUnitRootUrl()
      Specified by:
      getPersistenceUnitRootUrl in interface PersistenceUnitInfo
      Returns:
      The URL for the jar file that is the root of the persistence unit. If the persistence unit is rooted in the WEB-INF/classes directory, this will be the URL of that directory.
    • setPersistenceUnitRootUrl

      public void setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)
    • getManagedClassNames

      public List<String> getManagedClassNames()
      Specified by:
      getManagedClassNames in interface PersistenceUnitInfo
      Returns:
      The list of the names of the classes that the persistence provider must add it to its set of managed classes. Each name corresponds to a named <class> element in the persistence.xml file.
    • setManagedClassNames

      public void setManagedClassNames(List<String> managedClassNames)
    • excludeUnlistedClasses

      public boolean excludeUnlistedClasses()
      Specified by:
      excludeUnlistedClasses in interface PersistenceUnitInfo
      Returns:
      Whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes. This value corresponds to the <exclude-unlisted-classes> element in the persistence.xml file.
    • setExcludeUnlistedClasses

      public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
    • getProperties

      public Properties getProperties()
      Specified by:
      getProperties in interface PersistenceUnitInfo
      Returns:
      Properties object. Each property corresponds to a <property> element in the persistence.xml file
    • setProperties

      public void setProperties(Properties properties)
    • getClassLoader

      public ClassLoader getClassLoader()
      Specified by:
      getClassLoader in interface PersistenceUnitInfo
      Returns:
      ClassLoader that the provider may use to load any classes, resources, or open URLs.
    • addTransformer

      public void addTransformer(ClassTransformer transformer)
      Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the PersistenceUnitInfo.getClassLoader method. The transformer has no effect on the result returned by the PersistenceUnitInfo.getNewTempClassLoader method. Classes are only transformed once within the same classloading scope, regardless of how many persistence units they may be a part of.
      Specified by:
      addTransformer in interface PersistenceUnitInfo
      Parameters:
      transformer - A provider-supplied transformer that the Container invokes at class-(re)definition time
    • getNewTempClassLoader

      public ClassLoader getNewTempClassLoader()
      Return a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs. The scope and classpath of this loader is exactly the same as that of the loader returned by PersistenceUnitInfo.getClassLoader. None of the classes loaded by this class loader will be visible to application components.
      Specified by:
      getNewTempClassLoader in interface PersistenceUnitInfo
      Returns:
      Temporary ClassLoader with same visibility as current loader
    • setNewTempClassLoader

      public void setNewTempClassLoader(ClassLoader loader)
    • setSharedCacheMode

      public void setSharedCacheMode(String sharedCacheMode)
      Since:
      Java Persistence 2.0
      See Also:
    • setValidationMode

      public void setValidationMode(String validationMode)
      Since:
      Java Persistence 2.0
      See Also:
    • setClassLoader

      public void setClassLoader(ClassLoader loader)
    • getJarFiles

      public Collection<String> getJarFiles()
    • getPersistenceXMLSchemaVersion

      public String getPersistenceXMLSchemaVersion()
      Specified by:
      getPersistenceXMLSchemaVersion in interface PersistenceUnitInfo
      Since:
      Java Persistence 2.0
      See Also:
    • getSharedCacheMode

      public SharedCacheMode getSharedCacheMode()
      Specified by:
      getSharedCacheMode in interface PersistenceUnitInfo
      Since:
      Java Persistence 2.0
      See Also:
    • getValidationMode

      public ValidationMode getValidationMode()
      Specified by:
      getValidationMode in interface PersistenceUnitInfo
      Since:
      Java Persistence 2.0
      See Also: