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 shared RequestEntityContext when available or uses a new entity context otherwise.
Since:
8.0.0
Author:
XIMA MEDIA GmbH
  • Constructor Details

    • 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 be null, in which case the anonymous user is used.
  • Method Details

    • getUser

      public IUser getUser()
      Specified by:
      getUser in interface IEntityContext
    • hasBenutzer

      public boolean hasBenutzer()
      Specified by:
      hasBenutzer in interface IEntityContext
    • reopen

      public void reopen()
      Specified by:
      reopen in interface IEntityContext
    • getUserContext

      public UserContext getUserContext()
      Specified by:
      getUserContext in interface IEntityContext
    • setUserContext

      public void setUserContext(UserContext uc)
      Specified by:
      setUserContext in interface IEntityContext
    • setSkipValidation

      public void setSkipValidation(boolean skip)
      Specified by:
      setSkipValidation in interface IEntityContext
    • skipValidation

      public boolean skipValidation()
      Specified by:
      skipValidation in interface IEntityContext
    • getParameters

      public Map<Object,Object> getParameters()
      Specified by:
      getParameters in interface IEntityContext
    • postCommit

      public IEntityContext postCommit(de.xima.cmn.dao.interfaces.IPostCommitListener listener)
      Specified by:
      postCommit in interface IEntityContext
    • postRollback

      public IEntityContext postRollback(de.xima.cmn.dao.interfaces.IPostRollbackListener listener)
      Specified by:
      postRollback in interface IEntityContext
    • preCommit

      public IEntityContext preCommit(de.xima.cmn.dao.interfaces.IPreCommitListener listener)
      Specified by:
      preCommit in interface IEntityContext
    • preRollback

      public IEntityContext preRollback(de.xima.cmn.dao.interfaces.IPreRollbackListener listener)
      Specified by:
      preRollback in interface IEntityContext
    • features

      public IEntityContext features(de.xima.cmn.dao.enums.EEntityContextFeature... features)
      Specified by:
      features in interface IEntityContext
    • getBenutzer

      @Deprecated public Benutzer getBenutzer()
      Deprecated.
      Specified by:
      getBenutzer in interface IEntityContext
    • getPostCommitListeners

      public List<de.xima.cmn.dao.interfaces.IPostCommitListener> getPostCommitListeners()
      Specified by:
      getPostCommitListeners in interface de.xima.cmn.dao.interfaces.IBaseEntityContext
    • getPreCommitListeners

      public List<de.xima.cmn.dao.interfaces.IPreCommitListener> getPreCommitListeners()
      Specified by:
      getPreCommitListeners in interface de.xima.cmn.dao.interfaces.IBaseEntityContext
    • getPostRollbackListeners

      public List<de.xima.cmn.dao.interfaces.IPostRollbackListener> getPostRollbackListeners()
      Specified by:
      getPostRollbackListeners in interface de.xima.cmn.dao.interfaces.IBaseEntityContext
    • getPreRollbackListeners

      public List<de.xima.cmn.dao.interfaces.IPreRollbackListener> getPreRollbackListeners()
      Specified by:
      getPreRollbackListeners in interface de.xima.cmn.dao.interfaces.IBaseEntityContext
    • getEm

      public javax.persistence.EntityManager getEm()
      Specified by:
      getEm in interface de.xima.cmn.dao.interfaces.IBaseEntityContext
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface de.xima.cmn.dao.interfaces.IBaseEntityContext
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface de.xima.cmn.dao.interfaces.IBaseEntityContext