Package org.apache.tapestry5.jpa

# Interface TapestryPersistenceUnitInfo

All Superinterfaces:
  `javax.persistence.spi.PersistenceUnitInfo`

All Known Implementing Classes:
  `PersistenceUnitInfoImpl`

public interface TapestryPersistenceUnitInfo extends javax.persistence.spi.PersistenceUnitInfo
Tapestry's mutable extension of `PersistenceUnitInfo` interface used for XML-less configuration of persistence units.

Since:
  5.3

- ## Method Summary

  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.
  `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.
  `Map`
  `getEntityManagerProperties()`
  `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.
  `TapestryPersistenceUnitInfo`
  `sharedCacheMode(javax.persistence.SharedCacheMode cacheMode)`
  Defines how the persistence provider must use a second-level cache for the persistence unit.
  `TapestryPersistenceUnitInfo`
  `transactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)`
  Set the transaction type of the entity managers.
  `TapestryPersistenceUnitInfo`
  `validationMode(javax.persistence.ValidationMode validationMode)`
  Set the validation mode to be used by the persistence provider for the persistence unit.

  ### Methods inherited from interface javax.persistence.spi.PersistenceUnitInfo

  `addTransformer, excludeUnlistedClasses, getClassLoader, getJarFileUrls, getJtaDataSource, getManagedClassNames, getMappingFileNames, getNewTempClassLoader, getNonJtaDataSource, getPersistenceProviderClassName, getPersistenceUnitName, getPersistenceUnitRootUrl, getPersistenceXMLSchemaVersion, getProperties, getSharedCacheMode, getTransactionType, getValidationMode`

- ## Method Details

  - ### persistenceProviderClassName

    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.
    Parameters:
      `persistenceProviderClassName` - persistence provider's class name

  - ### transactionType

    TapestryPersistenceUnitInfo transactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)
    Set the transaction type of the entity managers. Corresponds to the `transaction-type` attribute in the `persistence.xml` file.
    Parameters:
      `transactionType` - transition type to set

  - ### nonJtaDataSource

    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.
    Parameters:
      `nonJtaDataSource` - data source to set

  - ### jtaDataSource

    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.
    Parameters:
      `jtaDataSource` - data source to set

  - ### addManagedClassName

    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.
    Parameters:
      `className` - class name to add
    See Also:
      - `addManagedClass(Class)`

  - ### addManagedClass

    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.
    Parameters:
      `clazz` - class to add
    See Also:
      - `addManagedClassName(String)`

  - ### sharedCacheMode

    TapestryPersistenceUnitInfo sharedCacheMode(javax.persistence.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.
    Parameters:
      `cacheMode` - cache mode to set

  - ### validationMode

    TapestryPersistenceUnitInfo validationMode(javax.persistence.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.
    Parameters:
      `validationMode` - validation mode to set

  - ### addMappingFileName

    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.
    Parameters:
      `fileName` - mapping file name to add

  - ### addJarFileUrl

    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.
    Parameters:
      `url` - url to add

  - ### addJarFileUrl

    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.
    Parameters:
      `url` - url to add

  - ### addProperty

    TapestryPersistenceUnitInfo addProperty(String name, String value)
    Add a property. Corresponds to a `property` element in the `persistence.xml` file.
    Parameters:
      `name` - property's name
      `value` - property's value

  - ### 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. Corresponds to the `exclude-unlisted-classes` element in the `persistence.xml` file.
    Parameters:
      `exclude` - defines whether to exclude or not

  - ### setEntityManagerProperties

    TapestryPersistenceUnitInfo setEntityManagerProperties(Map properties)
    `PersistenceProvider` allows creating an `EntityManagerFactory` with a default EntityManager properties map. This operation allows contributing default properties for EntityManager.
    Parameters:
      `properties` - properties to initialize EntityManagerFactory with
    Since:
      5.4

  - ### getEntityManagerProperties

    Map getEntityManagerProperties()
    Returns:
      Returns the supplied EntityManagerFactory properties. Returns null if not set.
    Since:
      5.4