|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.seam.persistence.PersistenceProvider
@Name(value="org.jboss.seam.persistence.persistenceProvider")
@Scope(value=STATELESS)
@BypassInterceptors
@Install(precedence=0,
classDependencies="javax.persistence.EntityManager")
public class PersistenceProviderAbstraction layer for persistence providers (JPA implementations). This class provides a working base implementation that can be optimized for performance and non-standardized features by extending and overriding the methods. The methods on this class are a great todo list for the next rev of the JPA spec ;-)
| Nested Class Summary | |
|---|---|
static class |
PersistenceProvider.Feature
|
| Field Summary | |
|---|---|
protected java.util.Set<PersistenceProvider.Feature> |
featureSet
|
| Constructor Summary | |
|---|---|
PersistenceProvider()
|
|
| Method Summary | |
|---|---|
void |
checkVersion(java.lang.Object bean,
javax.persistence.EntityManager entityManager,
java.lang.Object oldVersion,
java.lang.Object version)
|
void |
enableFilter(Filter filter,
javax.persistence.EntityManager entityManager)
Enable a Filter. |
java.lang.Class |
getBeanClass(java.lang.Object bean)
Returns the class of an entity bean instance |
java.lang.Object |
getId(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
Get the value of the entity identifier attribute. |
java.lang.String |
getName(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
Get the name of the entity |
java.lang.reflect.Method |
getPostLoadMethod(java.lang.Class beanClass)
Deprecated. |
java.lang.reflect.Method |
getPostLoadMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
|
java.lang.reflect.Method |
getPrePersistMethod(java.lang.Class beanClass)
Deprecated. |
java.lang.reflect.Method |
getPrePersistMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
|
java.lang.reflect.Method |
getPreRemoveMethod(java.lang.Class beanClass)
Deprecated. |
java.lang.reflect.Method |
getPreRemoveMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
|
java.lang.reflect.Method |
getPreUpdateMethod(java.lang.Class beanClass)
Deprecated. |
java.lang.reflect.Method |
getPreUpdateMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
|
java.lang.Object |
getVersion(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
Get the value of the entity version attribute. |
void |
init()
|
static PersistenceProvider |
instance()
|
boolean |
isDirty(javax.persistence.EntityManager entityManager)
Does the persistence context have unflushed changes? If it does not, persistence context replication can be optimized. |
java.lang.Object |
proxyDelegate(java.lang.Object delegate)
Wrap the delegate before returning it to the application |
javax.persistence.EntityManager |
proxyEntityManager(javax.persistence.EntityManager entityManager)
Wrap the entityManager before returning it to the application |
boolean |
registerSynchronization(javax.transaction.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). |
boolean |
supportsFeature(PersistenceProvider.Feature feature)
Indicate whether this JPA provider supports the feature defined by the provided Feature enum value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Set<PersistenceProvider.Feature> featureSet
| Constructor Detail |
|---|
public PersistenceProvider()
| Method Detail |
|---|
@PostConstruct public void init()
public boolean supportsFeature(PersistenceProvider.Feature feature)
public void setFlushModeManual(javax.persistence.EntityManager entityManager)
public void setRenderFlushMode()
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.
public boolean isDirty(javax.persistence.EntityManager entityManager)
public java.lang.Object getId(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
bean - a managed entity instance
public java.lang.String getName(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
throws java.lang.IllegalArgumentException
bean - entityManager -
java.lang.IllegalArgumentException - if the passed object is not an entity
public java.lang.Object getVersion(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
bean - a managed entity instance
public void checkVersion(java.lang.Object bean,
javax.persistence.EntityManager entityManager,
java.lang.Object oldVersion,
java.lang.Object version)
public void enableFilter(Filter filter,
javax.persistence.EntityManager entityManager)
public boolean registerSynchronization(javax.transaction.Synchronization sync,
javax.persistence.EntityManager entityManager)
public static PersistenceProvider instance()
public java.lang.Object proxyDelegate(java.lang.Object delegate)
public javax.persistence.EntityManager proxyEntityManager(javax.persistence.EntityManager entityManager)
public java.lang.Class getBeanClass(java.lang.Object bean)
bean - The entity bean instance
public java.lang.reflect.Method getPostLoadMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
public java.lang.reflect.Method getPrePersistMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
public java.lang.reflect.Method getPreUpdateMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
public java.lang.reflect.Method getPreRemoveMethod(java.lang.Object bean,
javax.persistence.EntityManager entityManager)
@Deprecated public java.lang.reflect.Method getPreRemoveMethod(java.lang.Class beanClass)
@Deprecated public java.lang.reflect.Method getPostLoadMethod(java.lang.Class beanClass)
@Deprecated public java.lang.reflect.Method getPrePersistMethod(java.lang.Class beanClass)
@Deprecated public java.lang.reflect.Method getPreUpdateMethod(java.lang.Class beanClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||