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 sharedRequestEntityContext
when 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 void
close()
IEntityContext
features(de.xima.cmn.dao.enums.EEntityContextFeature... features)
Benutzer
getBenutzer()
Deprecated.javax.persistence.EntityManager
getEm()
Map<Object,Object>
getParameters()
IUser
getUser()
UserContext
getUserContext()
boolean
hasBenutzer()
boolean
isOpen()
IEntityContext
postCommit(de.xima.cmn.dao.interfaces.IPostCommitListener listener)
IEntityContext
postRollback(de.xima.cmn.dao.interfaces.IPostRollbackListener listener)
IEntityContext
preCommit(de.xima.cmn.dao.interfaces.IPreCommitListener listener)
IEntityContext
preRollback(de.xima.cmn.dao.interfaces.IPreRollbackListener listener)
void
reopen()
void
setSkipValidation(boolean skip)
void
setUserContext(UserContext uc)
boolean
skipValidation()
-
-
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
features
public IEntityContext features(de.xima.cmn.dao.enums.EEntityContextFeature... features)
- Specified by:
features
in interfaceIEntityContext
-
getBenutzer
@Deprecated public Benutzer getBenutzer()
Deprecated.- Specified by:
getBenutzer
in interfaceIEntityContext
-
getEm
public javax.persistence.EntityManager getEm()
- Specified by:
getEm
in interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
getParameters
public Map<Object,Object> getParameters()
- Specified by:
getParameters
in interfaceIEntityContext
-
getUser
public IUser getUser()
- Specified by:
getUser
in interfaceIEntityContext
-
getUserContext
public UserContext getUserContext()
- Specified by:
getUserContext
in interfaceIEntityContext
-
hasBenutzer
public boolean hasBenutzer()
- Specified by:
hasBenutzer
in interfaceIEntityContext
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfacede.xima.cmn.dao.interfaces.IBaseEntityContext
-
postCommit
public IEntityContext postCommit(de.xima.cmn.dao.interfaces.IPostCommitListener listener)
- Specified by:
postCommit
in interfaceIEntityContext
-
postRollback
public IEntityContext postRollback(de.xima.cmn.dao.interfaces.IPostRollbackListener listener)
- Specified by:
postRollback
in interfaceIEntityContext
-
preCommit
public IEntityContext preCommit(de.xima.cmn.dao.interfaces.IPreCommitListener listener)
- Specified by:
preCommit
in interfaceIEntityContext
-
preRollback
public IEntityContext preRollback(de.xima.cmn.dao.interfaces.IPreRollbackListener listener)
- Specified by:
preRollback
in interfaceIEntityContext
-
reopen
public void reopen()
- Specified by:
reopen
in interfaceIEntityContext
-
setSkipValidation
public void setSkipValidation(boolean skip)
- Specified by:
setSkipValidation
in interfaceIEntityContext
-
setUserContext
public void setUserContext(UserContext uc)
- Specified by:
setUserContext
in interfaceIEntityContext
-
skipValidation
public boolean skipValidation()
- Specified by:
skipValidation
in interfaceIEntityContext
-
-