Class 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 Detail

      • PluginEntityContext

        public PluginEntityContext​(javax.persistence.EntityManagerFactory factory)
    • Method Detail

      • 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