Class PersistenceUnitMetaData

  • All Implemented Interfaces:
    Serializable

    public class PersistenceUnitMetaData
    extends MetaData
    MetaData representation of a "persistence.xml" persistence unit. Corresponds to the JPA spec section 6.2.1
    See Also:
    Serialized Form
    • Constructor Detail

      • PersistenceUnitMetaData

        public PersistenceUnitMetaData​(String name,
                                       String transactionType,
                                       URI rootURI)
        Constructor.
        Parameters:
        name - Name of the persistence unit
        transactionType - Transaction type for this unit
        rootURI - Root of the persistence-unit
    • Method Detail

      • getName

        public String getName()
      • getRootURI

        public URI getRootURI()
        Accessor for the persistence unit root.
        Returns:
        Root of the persistence unit
      • setTransactionType

        public void setTransactionType​(String transType)
      • getSharedCacheMode

        public String getSharedCacheMode()
        Accessor for the persistence unit shared cache mode.
        Returns:
        Caching policy: ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED.
      • setSharedCacheMode

        public void setSharedCacheMode​(String cache)
        Mutator for the shared cache mode.
        Parameters:
        cache - The shared cache mode: ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED.
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String desc)
      • getProvider

        public String getProvider()
      • setProvider

        public void setProvider​(String provider)
      • getJtaDataSource

        public String getJtaDataSource()
      • setJtaDataSource

        public void setJtaDataSource​(String data)
      • getNonJtaDataSource

        public String getNonJtaDataSource()
      • setNonJtaDataSource

        public void setNonJtaDataSource​(String data)
      • setValidationMode

        public void setValidationMode​(String validationMode)
        Mutator for the validation mode
        Parameters:
        validationMode - AUTO, CALLBACK or NONE
      • getValidationMode

        public String getValidationMode()
        Accessor to the Validation Mode
        Returns:
        AUTO, CALLBACK or NONE
      • setExcludeUnlistedClasses

        public void setExcludeUnlistedClasses​(boolean flag)
      • getExcludeUnlistedClasses

        public boolean getExcludeUnlistedClasses()
      • addClassName

        public void addClassName​(String className)
      • addClassNames

        public void addClassNames​(Set<String> classNames)
      • addJarFile

        public void addJarFile​(String jarName)
      • addJarFiles

        public void addJarFiles​(Set<String> jarNames)
      • addJarFile

        public void addJarFile​(URL jarURL)
        Method to add a jar file to the persistence unit.
        Parameters:
        jarURL - Jar file URL
      • clearJarFiles

        public void clearJarFiles()
        Convenience method to clear out all jar files.
      • addMappingFile

        public void addMappingFile​(String mappingFile)
      • addProperty

        public void addProperty​(String key,
                                String value)
      • getClassNames

        public Set<String> getClassNames()
      • getMappingFiles

        public Set<String> getMappingFiles()
      • getJarFiles

        public Set getJarFiles()
        Accessor for the jar files for this persistence unit. The contents of the Set may be Strings (the names) or URLs
        Returns:
        The jar names
      • getProperties

        public Properties getProperties()
      • toString

        public String toString​(String prefix,
                               String indent)
        Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.
        Parameters:
        prefix - prefix string
        indent - indent string
        Returns:
        a string representation of the object.