Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.seam.persistence
Class HibernatePersistenceProvider

    java.lang.Object
      org.jboss.seam.persistence.PersistenceProvider
          org.jboss.seam.persistence.HibernatePersistenceProvider

    @Name(value="org.jboss.seam.persistence.persistenceProvider")
    @Scope(value=STATELESS)
    @BypassInterceptors
    @Install(precedence=10,
             classDependencies={"org.hibernate.Session","javax.persistence.EntityManager"})
    public class HibernatePersistenceProvider

extends PersistenceProvider

Support for non-standardized features of Hibernate, when used as the JPA persistence provider.

Author:
  Gavin King, Pete Muir

Constructor Summary
`HibernatePersistenceProvider()`

Method Summary
`void` | `checkVersion(Object bean, javax.persistence.EntityManager entityManager, Object oldVersion, Object version)`
`static void` | `checkVersion(Object value, org.hibernate.Session session, Object oldVersion, Object version)`
`void` | `enableFilter(Filter f, javax.persistence.EntityManager entityManager)` Enable a Filter.
`Class` | `getBeanClass(Object bean)` Returns the class of the specified Hibernate entity
`static Class` | `getEntityClass(Object bean)`
`Object` | `getId(Object bean, javax.persistence.EntityManager entityManager)` Get the value of the entity identifier attribute.
`String` | `getName(Object bean, javax.persistence.EntityManager entityManager)` Get the name of the entity
`Object` | `getVersion(Object bean, javax.persistence.EntityManager entityManager)` Get the value of the entity version attribute.
`static Object` | `getVersion(Object value, org.hibernate.Session session)`
`static HibernatePersistenceProvider` | `instance()`
`boolean` | `isDirty(javax.persistence.EntityManager entityManager)` Does the persistence context have unflushed changes? If it does not, persistence context replication can be optimized.
`Object` | `proxyDelegate(Object delegate)` Wrap the delegate Hibernate Session in a proxy that supports HQL EL interpolation and implements FullTextSession if Hibernate Search is available in the classpath.
`javax.persistence.EntityManager` | `proxyEntityManager(javax.persistence.EntityManager entityManager)` Wrap the entityManager before returning it to the application
`boolean` | `registerSynchronization(Synchronization sync, javax.persistence.EntityManager entityManager)` Register a Synchronization with the current transaction.
`void` | `setFlushModeManual(javax.persistence.EntityManager entityManager)` Set the flush mode to manual-only flushing.

Methods inherited from class org.jboss.seam.persistence.PersistenceProvider
`getPostLoadMethod, getPostLoadMethod, getPrePersistMethod, getPrePersistMethod, getPreRemoveMethod, getPreRemoveMethod, getPreUpdateMethod, getPreUpdateMethod`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HibernatePersistenceProvider

    public HibernatePersistenceProvider()

Method Detail

### proxyDelegate

    public Object proxyDelegate(Object delegate)

  Wrap the delegate Hibernate Session in a proxy that supports HQL EL interpolation and implements FullTextSession if Hibernate Search is available in the classpath.

  Overrides:
    `proxyDelegate` in class `PersistenceProvider`

### setFlushModeManual

    public void setFlushModeManual(javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Set the flush mode to manual-only flushing. Called when an atomic persistence context is required.

  Overrides:
    `setFlushModeManual` in class `PersistenceProvider`

### isDirty

    public boolean isDirty(javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Does the persistence context have unflushed changes? If it does not, persistence context replication can be optimized.

  Overrides:
    `isDirty` in class `PersistenceProvider`
  Returns:
    true to indicate that there are unflushed changes

### getId

    public Object getId(Object bean,
                        javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Get the value of the entity identifier attribute.

  Overrides:
    `getId` in class `PersistenceProvider`
  Parameters:
    `bean` - a managed entity instance

### getVersion

    public Object getVersion(Object bean,
                             javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Get the value of the entity version attribute.

  Overrides:
    `getVersion` in class `PersistenceProvider`
  Parameters:
    `bean` - a managed entity instance

### checkVersion

    public void checkVersion(Object bean,
                             javax.persistence.EntityManager entityManager,
                             Object oldVersion,
                             Object version)

  Overrides:
    `checkVersion` in class `PersistenceProvider`

### enableFilter

    public void enableFilter(Filter f,
                             javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Enable a Filter. This is here just especially for Hibernate, since we well know that other products don't have such cool features.

  Overrides:
    `enableFilter` in class `PersistenceProvider`

### registerSynchronization

    public boolean registerSynchronization(Synchronization sync,
                                           javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Register a Synchronization with the current transaction.

  Overrides:
    `registerSynchronization` in class `PersistenceProvider`

### getName

    public String getName(Object bean,
                          javax.persistence.EntityManager entityManager)
                   throws IllegalArgumentException

  Description copied from class: `PersistenceProvider`
  Get the name of the entity

  Overrides:
    `getName` in class `PersistenceProvider`
  Throws:
    `IllegalArgumentException` - if the passed object is not an entity

### proxyEntityManager

    public javax.persistence.EntityManager proxyEntityManager(javax.persistence.EntityManager entityManager)

  Description copied from class: `PersistenceProvider`
  Wrap the entityManager before returning it to the application

  Overrides:
    `proxyEntityManager` in class `PersistenceProvider`

### checkVersion

    public static void checkVersion(Object value,
                                    org.hibernate.Session session,
                                    Object oldVersion,
                                    Object version)

### getVersion

    public static Object getVersion(Object value,
                                    org.hibernate.Session session)

### getBeanClass

    public Class getBeanClass(Object bean)

  Returns the class of the specified Hibernate entity

  Overrides:
    `getBeanClass` in class `PersistenceProvider`
  Parameters:
    `bean` - The entity bean instance
  Returns:
    The class of the entity bean

### getEntityClass

    public static Class getEntityClass(Object bean)

### instance

    public static HibernatePersistenceProvider instance()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD