|
Seam Core JSF2 2.3.1.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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
Support for non-standardized features of Hibernate, when used as the JPA persistence provider.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jboss.seam.persistence.PersistenceProvider |
---|
PersistenceProvider.Feature |
Field Summary |
---|
Fields inherited from class org.jboss.seam.persistence.PersistenceProvider |
---|
featureSet |
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. |
void |
setRenderFlushMode()
Set the FlushMode the persistence contexts should use during rendering by calling PersistenceContexts#changeFlushMode(FlushModeType, true) . |
Methods inherited from class org.jboss.seam.persistence.PersistenceProvider |
---|
getPostLoadMethod, getPostLoadMethod, getPrePersistMethod, getPrePersistMethod, getPreRemoveMethod, getPreRemoveMethod, getPreUpdateMethod, getPreUpdateMethod, init, supportsFeature |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HibernatePersistenceProvider()
Method Detail |
---|
public Object proxyDelegate(Object delegate)
proxyDelegate
in class PersistenceProvider
public void setFlushModeManual(javax.persistence.EntityManager entityManager)
PersistenceProvider
setFlushModeManual
in class PersistenceProvider
public void setRenderFlushMode()
PersistenceProvider
Set the FlushMode the persistence contexts should use during rendering by
calling PersistenceContexts#changeFlushMode(FlushModeType, true)
.
The actual changing of the flush mode is handled by the
PersistenceContexts
instance. The boolean argument should be true
to indicate that this is a temporary change and that the old flush mode
should be restored after render.
Ideally, this should be MANUAL since changes should never flush to the database while in render response and the cost of a dirty check can be avoided. However, since the MANUAL mode is not officially part of the JPA specification, the default implementation will perform no operation.
setRenderFlushMode
in class PersistenceProvider
public boolean isDirty(javax.persistence.EntityManager entityManager)
PersistenceProvider
isDirty
in class PersistenceProvider
public Object getId(Object bean, javax.persistence.EntityManager entityManager)
PersistenceProvider
getId
in class PersistenceProvider
bean
- a managed entity instancepublic Object getVersion(Object bean, javax.persistence.EntityManager entityManager)
PersistenceProvider
getVersion
in class PersistenceProvider
bean
- a managed entity instancepublic void checkVersion(Object bean, javax.persistence.EntityManager entityManager, Object oldVersion, Object version)
checkVersion
in class PersistenceProvider
public void enableFilter(Filter f, javax.persistence.EntityManager entityManager)
PersistenceProvider
enableFilter
in class PersistenceProvider
public boolean registerSynchronization(Synchronization sync, javax.persistence.EntityManager entityManager)
PersistenceProvider
registerSynchronization
in class PersistenceProvider
public String getName(Object bean, javax.persistence.EntityManager entityManager) throws IllegalArgumentException
PersistenceProvider
getName
in class PersistenceProvider
IllegalArgumentException
- if the passed object is not an entitypublic javax.persistence.EntityManager proxyEntityManager(javax.persistence.EntityManager entityManager)
PersistenceProvider
proxyEntityManager
in class PersistenceProvider
public static void checkVersion(Object value, org.hibernate.Session session, Object oldVersion, Object version)
public static Object getVersion(Object value, org.hibernate.Session session)
public Class getBeanClass(Object bean)
getBeanClass
in class PersistenceProvider
bean
- The entity bean instance
public static Class getEntityClass(Object bean)
public static HibernatePersistenceProvider instance()
|
Seam Core JSF2 2.3.1.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |