Class ContextualEntityContext
java.lang.Object
de.xima.fc.filter.db.ContextualEntityContext
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IBaseEntityContext, IEntityContext, Closeable, AutoCloseable
An entity context intended to be used when you do not know whether you are inside a UI thread or not. Either
delegates to the shared
RequestEntityContext when available or uses a new entity context otherwise.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
ConstructorsConstructorDescriptionContextualEntityContext(IUser user) Creates a new contextual entity context that delegates either to the shared request entity context or a new entity context.Creates a new contextual entity context that delegates either to the shared request entity context or a new entity context. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns a supplier that creates new contextual entity contexts with the given user.features(de.xima.cmn.dao.enums.EEntityContextFeature... features) Deprecated.javax.persistence.EntityManagergetEm()List<de.xima.cmn.dao.interfaces.IPostCommitListener> List<de.xima.cmn.dao.interfaces.IPostRollbackListener> List<de.xima.cmn.dao.interfaces.IPreCommitListener> List<de.xima.cmn.dao.interfaces.IPreRollbackListener> getUser()booleanbooleanisOpen()postCommit(de.xima.cmn.dao.interfaces.IPostCommitListener listener) postRollback(de.xima.cmn.dao.interfaces.IPostRollbackListener listener) preCommit(de.xima.cmn.dao.interfaces.IPreCommitListener listener) preRollback(de.xima.cmn.dao.interfaces.IPreRollbackListener listener) voidreopen()voidsetSkipValidation(boolean skip) voidbooleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.cmn.dao.interfaces.IBaseEntityContext
getFeaturesMethods inherited from interface IEntityContext
getParameter
-
Constructor Details
-
ContextualEntityContext
Creates a new contextual entity context that delegates either to the shared request entity context or a new entity context.- Parameters:
user- User context, can benull, in which case the anonymous user is used.
-
ContextualEntityContext
Creates a new contextual entity context that delegates either to the shared request entity context or a new entity context.- Parameters:
uc- User context, can benull, in which case the anonymous user is used.
-
-
Method Details
-
getUser
- Specified by:
getUserin interfaceIEntityContext
-
hasBenutzer
public boolean hasBenutzer()- Specified by:
hasBenutzerin interfaceIEntityContext
-
reopen
public void reopen()- Specified by:
reopenin interfaceIEntityContext
-
getUserContext
- Specified by:
getUserContextin interfaceIEntityContext
-
setUserContext
- Specified by:
setUserContextin interfaceIEntityContext
-
setSkipValidation
public void setSkipValidation(boolean skip) - Specified by:
setSkipValidationin interfaceIEntityContext
-
skipValidation
public boolean skipValidation()- Specified by:
skipValidationin interfaceIEntityContext
-
getParameters
- Specified by:
getParametersin interfaceIEntityContext
-
postCommit
- Specified by:
postCommitin interfaceIEntityContext
-
postRollback
- Specified by:
postRollbackin interfaceIEntityContext
-
preCommit
- Specified by:
preCommitin interfaceIEntityContext
-
preRollback
- Specified by:
preRollbackin interfaceIEntityContext
-
features
- Specified by:
featuresin interfaceIEntityContext
-
getBenutzer
Deprecated.- Specified by:
getBenutzerin interfaceIEntityContext
-
getPostCommitListeners
- Specified by:
getPostCommitListenersin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
getPreCommitListeners
- Specified by:
getPreCommitListenersin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
getPostRollbackListeners
- Specified by:
getPostRollbackListenersin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
getPreRollbackListeners
- Specified by:
getPreRollbackListenersin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
getEm
public javax.persistence.EntityManager getEm()- Specified by:
getEmin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
contextualEntityContextFactory
public static ISerializableThrowingSupplier<IEntityContext> contextualEntityContextFactory(IUser user) Returns a supplier that creates new contextual entity contexts with the given user. SeeContextualEntityContext(IUser).- Parameters:
user- User context, can benull, in which case the anonymous user is used.- Returns:
- A supplier that creates new contextual entity contexts with the given user.
-