Class PluginEntityContext

java.lang.Object
de.xima.fc.filter.db.PluginEntityContext
All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IBaseEntityContext, Closeable, AutoCloseable

public class PluginEntityContext extends Object implements de.xima.cmn.dao.interfaces.IBaseEntityContext, AutoCloseable, Closeable
An entity context for use by an entities plugin. Normally, you should not create this context manually, use IPluginEmManager.newEntityContext() instead.

This entity context implements AutoCloseable. Calling the close() will close the EntityManager if

  • the entity manager was created by this class during a call to getEm(); and
  • we are currently not within the context of an HTTP request that is managed by the ConnectionFilter
When an existing entity manager is reused, it will not be closed by this context and must be closed by whoever created it.
Author:
XIMA MEDIA GmbH
  • Constructor Summary

    Constructors
    Constructor
    Description
    PluginEntityContext(javax.persistence.EntityManagerFactory factory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    javax.persistence.EntityManager
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.xima.cmn.dao.interfaces.IBaseEntityContext

    getFeatures, getPostCommitListeners, getPostRollbackListeners, getPreCommitListeners, getPreRollbackListeners
  • Constructor Details

    • PluginEntityContext

      public PluginEntityContext(javax.persistence.EntityManagerFactory factory)
  • Method Details

    • 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