|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SeamPersistenceProvider
The interface can be implemented to provide extra functionality to a seam managed persistence context.
seam-persistence contains a default implementation and a hibernate based implementation. Persistence providers are services rather than beans. Injection etc is not availible and the implementations classes must be listed in META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider
Method Summary | |
---|---|
void |
checkVersion(Object bean,
EntityManager entityManager,
Object oldVersion,
Object version)
|
Set<Class<?>> |
getAdditionalEntityManagerInterfaces()
|
Class<?> |
getBeanClass(Object bean)
Returns the class of an entity bean instance |
Object |
getId(Object bean,
EntityManager entityManager)
Get the value of the entity identifier attribute. |
String |
getName(Object bean,
EntityManager entityManager)
Get the name of the entity |
FlushModeType |
getRenderFlushMode()
Gets the FlushMode the persistence contexts should use during rendering |
Object |
getVersion(Object bean,
EntityManager entityManager)
Get the value of the entity version attribute. |
boolean |
isCorrectProvider(EntityManager em)
Should return true if this is the correct persistence provider for the given entity manager factory |
boolean |
isDirty(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 before returning it to the application |
EntityManager |
proxyEntityManager(EntityManager entityManager)
|
boolean |
registerSynchronization(Synchronization sync,
EntityManager entityManager)
Register a Synchronization with the current transaction. |
void |
setFlushMode(EntityManager entityManager,
FlushModeType type)
sets the flush mode |
void |
setFlushModeManual(EntityManager entityManager)
Set the flush mode to manual-only flushing. |
Method Detail |
---|
void setFlushMode(EntityManager entityManager, FlushModeType type)
boolean isCorrectProvider(EntityManager em)
void setFlushModeManual(EntityManager entityManager)
FlushModeType getRenderFlushMode()
Gets the FlushMode the persistence contexts should use during rendering
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.
boolean isDirty(EntityManager entityManager)
Object getId(Object bean, EntityManager entityManager)
bean
- a managed entity instanceString getName(Object bean, EntityManager entityManager) throws IllegalArgumentException
bean
- entityManager
-
IllegalArgumentException
- if the passed object is not an entityObject getVersion(Object bean, EntityManager entityManager)
bean
- a managed entity instancevoid checkVersion(Object bean, EntityManager entityManager, Object oldVersion, Object version)
boolean registerSynchronization(Synchronization sync, EntityManager entityManager)
Object proxyDelegate(Object delegate)
EntityManager proxyEntityManager(EntityManager entityManager)
Set<Class<?>> getAdditionalEntityManagerInterfaces()
Class<?> getBeanClass(Object bean)
bean
- The entity bean instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |