Package org.apache.tapestry5.internal.jpa

## Class PersistenceUnitInfoImpl

- java.lang.Object
- - org.apache.tapestry5.internal.jpa.PersistenceUnitInfoImpl

- All Implemented Interfaces:
    `PersistenceUnitInfo`, `TapestryPersistenceUnitInfo`

      public class PersistenceUnitInfoImpl
      extends Object
      implements TapestryPersistenceUnitInfo

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PersistenceUnitInfoImpl​(String persistenceUnitName)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `TapestryPersistenceUnitInfo` | `addJarFileUrl​(String url)` | Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit.
    `TapestryPersistenceUnitInfo` | `addJarFileUrl​(URL url)` | Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit.
    `TapestryPersistenceUnitInfo` | `addManagedClass​(Class<?> clazz)` | Add a managed class to be used by persistence provider.
    `TapestryPersistenceUnitInfo` | `addManagedClassName​(String className)` | Add a managed class name to be used by persistence provider.
    `TapestryPersistenceUnitInfo` | `addMappingFileName​(String fileName)` | Add a mapping file to be loaded by the persistence provider to determine the mappings for the entity classes.
    `TapestryPersistenceUnitInfo` | `addProperty​(String name, String value)` | Add a property.
    `void` | `addTransformer​(ClassTransformer transformer)`
    `boolean` | `excludeUnlistedClasses()`
    `TapestryPersistenceUnitInfo` | `excludeUnlistedClasses​(boolean exclude)` | Defines 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.
    `ClassLoader` | `getClassLoader()`
    `Map` | `getEntityManagerProperties()` |
    `List<URL>` | `getJarFileUrls()`
    `DataSource` | `getJtaDataSource()`
    `List<String>` | `getManagedClassNames()`
    `List<String>` | `getMappingFileNames()`
    `ClassLoader` | `getNewTempClassLoader()`
    `DataSource` | `getNonJtaDataSource()`
    `String` | `getPersistenceProviderClassName()`
    `String` | `getPersistenceUnitName()`
    `URL` | `getPersistenceUnitRootUrl()`
    `String` | `getPersistenceXMLSchemaVersion()`
    `Properties` | `getProperties()`
    `SharedCacheMode` | `getSharedCacheMode()`
    `PersistenceUnitTransactionType` | `getTransactionType()`
    `ValidationMode` | `getValidationMode()`
    `TapestryPersistenceUnitInfo` | `jtaDataSource​(String jtaDataSource)` | Set the JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.
    `TapestryPersistenceUnitInfo` | `nonJtaDataSource​(String nonJtaDataSource)` | Set the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.
    `TapestryPersistenceUnitInfo` | `persistenceProviderClassName​(String persistenceProviderClassName)` | Set the the fully qualified name of the persistence provider implementation class.
    `TapestryPersistenceUnitInfo` | `setEntityManagerProperties​(Map properties)` | `PersistenceProvider` allows creating an `EntityManagerFactory` with a default EntityManager properties map.
    `void` | `setPersistenceXMLSchemaVersion​(String version)` |
    `TapestryPersistenceUnitInfo` | `sharedCacheMode​(SharedCacheMode cacheMode)` | Defines how the persistence provider must use a second-level cache for the persistence unit.
    `TapestryPersistenceUnitInfo` | `transactionType​(PersistenceUnitTransactionType transactionType)` | Set the transaction type of the entity managers.
    `TapestryPersistenceUnitInfo` | `validationMode​(ValidationMode validationMode)` | Set the validation mode to be used by the persistence provider for the persistence unit.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PersistenceUnitInfoImpl

          public PersistenceUnitInfoImpl​(String persistenceUnitName)

  - ### Method Detail

    - #### getPersistenceUnitName

          public String getPersistenceUnitName()

      Specified by:
        `getPersistenceUnitName` in interface `PersistenceUnitInfo`

    - #### getPersistenceProviderClassName

          public String getPersistenceProviderClassName()

      Specified by:
        `getPersistenceProviderClassName` in interface `PersistenceUnitInfo`

    - #### persistenceProviderClassName

          public TapestryPersistenceUnitInfo persistenceProviderClassName​(String persistenceProviderClassName)

      Set the the fully qualified name of the persistence provider implementation class. Corresponds to the `provider` element in the `persistence.xml` file.
      Specified by:
        `persistenceProviderClassName` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `persistenceProviderClassName` - persistence provider's class name

    - #### getTransactionType

          public PersistenceUnitTransactionType getTransactionType()

      Specified by:
        `getTransactionType` in interface `PersistenceUnitInfo`

    - #### transactionType

          public TapestryPersistenceUnitInfo transactionType​(PersistenceUnitTransactionType transactionType)

      Set the transaction type of the entity managers. Corresponds to the `transaction-type` attribute in the `persistence.xml` file.
      Specified by:
        `transactionType` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `transactionType` - transition type to set

    - #### getJtaDataSource

          public DataSource getJtaDataSource()

      Specified by:
        `getJtaDataSource` in interface `PersistenceUnitInfo`

    - #### getNonJtaDataSource

          public DataSource getNonJtaDataSource()

      Specified by:
        `getNonJtaDataSource` in interface `PersistenceUnitInfo`

    - #### nonJtaDataSource

          public TapestryPersistenceUnitInfo nonJtaDataSource​(String nonJtaDataSource)

      Set the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. Corresponds to the named `non-jta-data-source` element in the `persistence.xml` file.
      Specified by:
        `nonJtaDataSource` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `nonJtaDataSource` - data source to set

    - #### jtaDataSource

          public TapestryPersistenceUnitInfo jtaDataSource​(String jtaDataSource)

      Set the JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. Corresponds to the named `jta-data-source` element in the `persistence.xml` file.
      Specified by:
        `jtaDataSource` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `jtaDataSource` - data source to set

    - #### getMappingFileNames

          public List<String> getMappingFileNames()

      Specified by:
        `getMappingFileNames` in interface `PersistenceUnitInfo`

    - #### addMappingFileName

          public TapestryPersistenceUnitInfo addMappingFileName​(String fileName)

      Add a mapping file to be loaded by the persistence provider to determine the mappings for the entity classes. Corresponds to a `mapping-file` element in the `persistence.xml` file.
      Specified by:
        `addMappingFileName` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `fileName` - mapping file name to add

    - #### addJarFileUrl

          public TapestryPersistenceUnitInfo addJarFileUrl​(URL url)

      Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit. Corresponds to a `jar-file` element in the `persistence.xml` file.
      Specified by:
        `addJarFileUrl` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `url` - url to add

    - #### addJarFileUrl

          public TapestryPersistenceUnitInfo addJarFileUrl​(String url)

      Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit. Corresponds to a `jar-file` element in the `persistence.xml` file.
      Specified by:
        `addJarFileUrl` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `url` - url to add

    - #### addProperty

          public TapestryPersistenceUnitInfo addProperty​(String name,
                                                         String value)

      Add a property. Corresponds to a `property` element in the `persistence.xml` file.
      Specified by:
        `addProperty` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `name` - property's name
        `value` - property's value

    - #### excludeUnlistedClasses

          public TapestryPersistenceUnitInfo excludeUnlistedClasses​(boolean exclude)

      Defines 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. Corresponds to the `exclude-unlisted-classes` element in the `persistence.xml` file.
      Specified by:
        `excludeUnlistedClasses` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `exclude` - defines whether to exclude or not

    - #### getJarFileUrls

          public List<URL> getJarFileUrls()

      Specified by:
        `getJarFileUrls` in interface `PersistenceUnitInfo`

    - #### getPersistenceUnitRootUrl

          public URL getPersistenceUnitRootUrl()

      Specified by:
        `getPersistenceUnitRootUrl` in interface `PersistenceUnitInfo`

    - #### getManagedClassNames

          public List<String> getManagedClassNames()

      Specified by:
        `getManagedClassNames` in interface `PersistenceUnitInfo`

    - #### addManagedClassName

          public TapestryPersistenceUnitInfo addManagedClassName​(String className)

      Add a managed class name to be used by persistence provider. Corresponds to a named `class` element in the `persistence.xml` file.
      Specified by:
        `addManagedClassName` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `className` - class name to add
      See Also:
        `TapestryPersistenceUnitInfo.addManagedClass(Class)`

    - #### addManagedClass

          public TapestryPersistenceUnitInfo addManagedClass​(Class<?> clazz)

      Add a managed class to be used by persistence provider. Corresponds to a named `class` element in the `persistence.xml` file.
      Specified by:
        `addManagedClass` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `clazz` - class to add
      See Also:
        `TapestryPersistenceUnitInfo.addManagedClassName(String)`

    - #### excludeUnlistedClasses

          public boolean excludeUnlistedClasses()

      Specified by:
        `excludeUnlistedClasses` in interface `PersistenceUnitInfo`

    - #### getSharedCacheMode

          public SharedCacheMode getSharedCacheMode()

      Specified by:
        `getSharedCacheMode` in interface `PersistenceUnitInfo`

    - #### sharedCacheMode

          public TapestryPersistenceUnitInfo sharedCacheMode​(SharedCacheMode cacheMode)

      Defines how the persistence provider must use a second-level cache for the persistence unit. Corresponds to the `shared-cache-mode` element in the `persistence.xml` file.
      Specified by:
        `sharedCacheMode` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `cacheMode` - cache mode to set

    - #### getValidationMode

          public ValidationMode getValidationMode()

      Specified by:
        `getValidationMode` in interface `PersistenceUnitInfo`

    - #### validationMode

          public TapestryPersistenceUnitInfo validationMode​(ValidationMode validationMode)

      Set the validation mode to be used by the persistence provider for the persistence unit. Corresponds to the `validation-mode` element in the `persistence.xml` file.
      Specified by:
        `validationMode` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `validationMode` - validation mode to set

    - #### getProperties

          public Properties getProperties()

      Specified by:
        `getProperties` in interface `PersistenceUnitInfo`

    - #### getPersistenceXMLSchemaVersion

          public String getPersistenceXMLSchemaVersion()

      Specified by:
        `getPersistenceXMLSchemaVersion` in interface `PersistenceUnitInfo`

    - #### setPersistenceXMLSchemaVersion

          public void setPersistenceXMLSchemaVersion​(String version)

    - #### getClassLoader

          public ClassLoader getClassLoader()

      Specified by:
        `getClassLoader` in interface `PersistenceUnitInfo`

    - #### addTransformer

          public void addTransformer​(ClassTransformer transformer)

      Specified by:
        `addTransformer` in interface `PersistenceUnitInfo`

    - #### getNewTempClassLoader

          public ClassLoader getNewTempClassLoader()

      Specified by:
        `getNewTempClassLoader` in interface `PersistenceUnitInfo`

    - #### setEntityManagerProperties

          public TapestryPersistenceUnitInfo setEntityManagerProperties​(Map properties)

      Description copied from interface: `TapestryPersistenceUnitInfo`
      `PersistenceProvider` allows creating an `EntityManagerFactory` with a default EntityManager properties map. This operation allows contributing default properties for EntityManager.
      Specified by:
        `setEntityManagerProperties` in interface `TapestryPersistenceUnitInfo`
      Parameters:
        `properties` - properties to initialize EntityManagerFactory with

    - #### getEntityManagerProperties

          public Map getEntityManagerProperties()

      Specified by:
        `getEntityManagerProperties` in interface `TapestryPersistenceUnitInfo`
      Returns:
        Returns the supplied EntityManagerFactory properties. Returns null if not set.