Package de.xima.fc.filter.db
Class ContextualEntityContext
- java.lang.Object
-
- de.xima.fc.filter.db.ContextualEntityContext
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IBaseEntityContext,IEntityContext,Closeable,AutoCloseable
public final class ContextualEntityContext extends Object implements IEntityContext
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 sharedRequestEntityContextwhen available or uses a new entity context otherwise.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description ContextualEntityContext(UserContext uc)Creates a new contextual entity context that delegates either to the shared request entity context or a new entity context.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()IEntityContextfeatures(de.xima.cmn.dao.enums.EEntityContextFeature... features)BenutzergetBenutzer()Deprecated.javax.persistence.EntityManagergetEm()Map<Object,Object>getParameters()IUsergetUser()UserContextgetUserContext()booleanhasBenutzer()booleanisOpen()IEntityContextpostCommit(de.xima.cmn.dao.interfaces.IPostCommitListener listener)IEntityContextpostRollback(de.xima.cmn.dao.interfaces.IPostRollbackListener listener)IEntityContextpreCommit(de.xima.cmn.dao.interfaces.IPreCommitListener listener)IEntityContextpreRollback(de.xima.cmn.dao.interfaces.IPreRollbackListener listener)voidreopen()voidsetSkipValidation(boolean skip)voidsetUserContext(UserContext uc)booleanskipValidation()
-
-
-
Constructor Detail
-
ContextualEntityContext
public ContextualEntityContext(UserContext uc)
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 Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
features
public IEntityContext features(de.xima.cmn.dao.enums.EEntityContextFeature... features)
- Specified by:
featuresin interfaceIEntityContext
-
getBenutzer
@Deprecated public Benutzer getBenutzer()
Deprecated.- Specified by:
getBenutzerin interfaceIEntityContext
-
getEm
public javax.persistence.EntityManager getEm()
- Specified by:
getEmin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
getParameters
public Map<Object,Object> getParameters()
- Specified by:
getParametersin interfaceIEntityContext
-
getUser
public IUser getUser()
- Specified by:
getUserin interfaceIEntityContext
-
getUserContext
public UserContext getUserContext()
- Specified by:
getUserContextin interfaceIEntityContext
-
hasBenutzer
public boolean hasBenutzer()
- Specified by:
hasBenutzerin interfaceIEntityContext
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
postCommit
public IEntityContext postCommit(de.xima.cmn.dao.interfaces.IPostCommitListener listener)
- Specified by:
postCommitin interfaceIEntityContext
-
postRollback
public IEntityContext postRollback(de.xima.cmn.dao.interfaces.IPostRollbackListener listener)
- Specified by:
postRollbackin interfaceIEntityContext
-
preCommit
public IEntityContext preCommit(de.xima.cmn.dao.interfaces.IPreCommitListener listener)
- Specified by:
preCommitin interfaceIEntityContext
-
preRollback
public IEntityContext preRollback(de.xima.cmn.dao.interfaces.IPreRollbackListener listener)
- Specified by:
preRollbackin interfaceIEntityContext
-
reopen
public void reopen()
- Specified by:
reopenin interfaceIEntityContext
-
setSkipValidation
public void setSkipValidation(boolean skip)
- Specified by:
setSkipValidationin interfaceIEntityContext
-
setUserContext
public void setUserContext(UserContext uc)
- Specified by:
setUserContextin interfaceIEntityContext
-
skipValidation
public boolean skipValidation()
- Specified by:
skipValidationin interfaceIEntityContext
-
-