Class EntityManagerDecorator

  • All Implemented Interfaces:
    javax.persistence.EntityManager

    public class EntityManagerDecorator
    extends java.lang.Object
    implements javax.persistence.EntityManager
    Author:
    Federico Alcantara
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityManagerDecorator​(javax.persistence.EntityManager unDecoratedManager)
      Constructor for attaching decoration to EntityManager
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void close()  
      boolean contains​(java.lang.Object arg0)  
      <T> javax.persistence.EntityGraph<T> createEntityGraph​(java.lang.Class<T> arg0)  
      javax.persistence.EntityGraph<?> createEntityGraph​(java.lang.String arg0)  
      javax.persistence.Query createNamedQuery​(java.lang.String arg0)  
      <T> javax.persistence.TypedQuery<T> createNamedQuery​(java.lang.String arg0, java.lang.Class<T> arg1)  
      javax.persistence.StoredProcedureQuery createNamedStoredProcedureQuery​(java.lang.String arg0)  
      javax.persistence.Query createNativeQuery​(java.lang.String arg0)  
      javax.persistence.Query createNativeQuery​(java.lang.String arg0, java.lang.Class arg1)  
      javax.persistence.Query createNativeQuery​(java.lang.String arg0, java.lang.String arg1)  
      javax.persistence.Query createQuery​(java.lang.String arg0)  
      <T> javax.persistence.TypedQuery<T> createQuery​(java.lang.String arg0, java.lang.Class<T> arg1)  
      javax.persistence.Query createQuery​(javax.persistence.criteria.CriteriaDelete arg0)  
      <T> javax.persistence.TypedQuery<T> createQuery​(javax.persistence.criteria.CriteriaQuery<T> arg0)  
      javax.persistence.Query createQuery​(javax.persistence.criteria.CriteriaUpdate arg0)  
      javax.persistence.StoredProcedureQuery createStoredProcedureQuery​(java.lang.String arg0)  
      javax.persistence.StoredProcedureQuery createStoredProcedureQuery​(java.lang.String arg0, java.lang.Class... arg1)  
      javax.persistence.StoredProcedureQuery createStoredProcedureQuery​(java.lang.String arg0, java.lang.String... arg1)  
      void detach​(java.lang.Object arg0)  
      <T> T find​(java.lang.Class<T> arg0, java.lang.Object arg1)  
      <T> T find​(java.lang.Class<T> arg0, java.lang.Object arg1, java.util.Map<java.lang.String,​java.lang.Object> arg2)  
      <T> T find​(java.lang.Class<T> arg0, java.lang.Object arg1, javax.persistence.LockModeType arg2)  
      <T> T find​(java.lang.Class<T> arg0, java.lang.Object arg1, javax.persistence.LockModeType arg2, java.util.Map<java.lang.String,​java.lang.Object> arg3)  
      void flush()  
      javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()  
      java.lang.Object getDelegate()  
      javax.persistence.EntityGraph<?> getEntityGraph​(java.lang.String arg0)  
      <T> java.util.List<javax.persistence.EntityGraph<? super T>> getEntityGraphs​(java.lang.Class<T> arg0)  
      javax.persistence.EntityManagerFactory getEntityManagerFactory()  
      javax.persistence.FlushModeType getFlushMode()  
      javax.persistence.LockModeType getLockMode​(java.lang.Object arg0)  
      javax.persistence.metamodel.Metamodel getMetamodel()  
      java.util.Map<java.lang.String,​java.lang.Object> getProperties()  
      <T> T getReference​(java.lang.Class<T> arg0, java.lang.Object arg1)  
      javax.persistence.EntityTransaction getTransaction()  
      boolean isJoinedToTransaction()  
      boolean isOpen()  
      void joinTransaction()  
      void lock​(java.lang.Object arg0, javax.persistence.LockModeType arg1)  
      void lock​(java.lang.Object arg0, javax.persistence.LockModeType arg1, java.util.Map<java.lang.String,​java.lang.Object> arg2)  
      <T> T merge​(T arg0)  
      void persist​(java.lang.Object object)
      Before and after persisting an object the PreCreate and PostCreate call backs found in the object are executed.
      void refresh​(java.lang.Object arg0)  
      void refresh​(java.lang.Object arg0, java.util.Map<java.lang.String,​java.lang.Object> arg1)  
      void refresh​(java.lang.Object arg0, javax.persistence.LockModeType arg1)  
      void refresh​(java.lang.Object arg0, javax.persistence.LockModeType arg1, java.util.Map<java.lang.String,​java.lang.Object> arg2)  
      void remove​(java.lang.Object arg0)
      Before removing an object the PreDelete call backs encountered in the object are executed.
      void setFlushMode​(javax.persistence.FlushModeType arg0)  
      void setProperty​(java.lang.String arg0, java.lang.Object arg1)  
      <T> T unwrap​(java.lang.Class<T> arg0)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EntityManagerDecorator

        public EntityManagerDecorator​(javax.persistence.EntityManager unDecoratedManager)
        Constructor for attaching decoration to EntityManager
        Parameters:
        unDecoratedManager -
    • Method Detail

      • persist

        public void persist​(java.lang.Object object)
        Before and after persisting an object the PreCreate and PostCreate call backs found in the object are executed. These calls occurs within a transaction.
        Specified by:
        persist in interface javax.persistence.EntityManager
        Parameters:
        object - Object to be persisted
      • remove

        public void remove​(java.lang.Object arg0)
        Before removing an object the PreDelete call backs encountered in the object are executed. These calls occurs within a transaction.
        Specified by:
        remove in interface javax.persistence.EntityManager
        Parameters:
        arg0 - Object to be removed
      • clear

        public void clear()
        Specified by:
        clear in interface javax.persistence.EntityManager
      • close

        public void close()
        Specified by:
        close in interface javax.persistence.EntityManager
      • contains

        public boolean contains​(java.lang.Object arg0)
        Specified by:
        contains in interface javax.persistence.EntityManager
      • createNamedQuery

        public javax.persistence.Query createNamedQuery​(java.lang.String arg0)
        Specified by:
        createNamedQuery in interface javax.persistence.EntityManager
      • createNamedQuery

        public <T> javax.persistence.TypedQuery<T> createNamedQuery​(java.lang.String arg0,
                                                                    java.lang.Class<T> arg1)
        Specified by:
        createNamedQuery in interface javax.persistence.EntityManager
      • createNativeQuery

        public javax.persistence.Query createNativeQuery​(java.lang.String arg0)
        Specified by:
        createNativeQuery in interface javax.persistence.EntityManager
      • createNativeQuery

        public javax.persistence.Query createNativeQuery​(java.lang.String arg0,
                                                         java.lang.Class arg1)
        Specified by:
        createNativeQuery in interface javax.persistence.EntityManager
      • createNativeQuery

        public javax.persistence.Query createNativeQuery​(java.lang.String arg0,
                                                         java.lang.String arg1)
        Specified by:
        createNativeQuery in interface javax.persistence.EntityManager
      • createQuery

        public javax.persistence.Query createQuery​(java.lang.String arg0)
        Specified by:
        createQuery in interface javax.persistence.EntityManager
      • createQuery

        public <T> javax.persistence.TypedQuery<T> createQuery​(javax.persistence.criteria.CriteriaQuery<T> arg0)
        Specified by:
        createQuery in interface javax.persistence.EntityManager
      • createQuery

        public <T> javax.persistence.TypedQuery<T> createQuery​(java.lang.String arg0,
                                                               java.lang.Class<T> arg1)
        Specified by:
        createQuery in interface javax.persistence.EntityManager
      • detach

        public void detach​(java.lang.Object arg0)
        Specified by:
        detach in interface javax.persistence.EntityManager
      • find

        public <T> T find​(java.lang.Class<T> arg0,
                          java.lang.Object arg1)
        Specified by:
        find in interface javax.persistence.EntityManager
      • find

        public <T> T find​(java.lang.Class<T> arg0,
                          java.lang.Object arg1,
                          java.util.Map<java.lang.String,​java.lang.Object> arg2)
        Specified by:
        find in interface javax.persistence.EntityManager
      • find

        public <T> T find​(java.lang.Class<T> arg0,
                          java.lang.Object arg1,
                          javax.persistence.LockModeType arg2)
        Specified by:
        find in interface javax.persistence.EntityManager
      • find

        public <T> T find​(java.lang.Class<T> arg0,
                          java.lang.Object arg1,
                          javax.persistence.LockModeType arg2,
                          java.util.Map<java.lang.String,​java.lang.Object> arg3)
        Specified by:
        find in interface javax.persistence.EntityManager
      • flush

        public void flush()
        Specified by:
        flush in interface javax.persistence.EntityManager
      • getCriteriaBuilder

        public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
        Specified by:
        getCriteriaBuilder in interface javax.persistence.EntityManager
      • getDelegate

        public java.lang.Object getDelegate()
        Specified by:
        getDelegate in interface javax.persistence.EntityManager
      • getEntityManagerFactory

        public javax.persistence.EntityManagerFactory getEntityManagerFactory()
        Specified by:
        getEntityManagerFactory in interface javax.persistence.EntityManager
      • getFlushMode

        public javax.persistence.FlushModeType getFlushMode()
        Specified by:
        getFlushMode in interface javax.persistence.EntityManager
      • getLockMode

        public javax.persistence.LockModeType getLockMode​(java.lang.Object arg0)
        Specified by:
        getLockMode in interface javax.persistence.EntityManager
      • getMetamodel

        public javax.persistence.metamodel.Metamodel getMetamodel()
        Specified by:
        getMetamodel in interface javax.persistence.EntityManager
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getProperties()
        Specified by:
        getProperties in interface javax.persistence.EntityManager
      • getReference

        public <T> T getReference​(java.lang.Class<T> arg0,
                                  java.lang.Object arg1)
        Specified by:
        getReference in interface javax.persistence.EntityManager
      • getTransaction

        public javax.persistence.EntityTransaction getTransaction()
        Specified by:
        getTransaction in interface javax.persistence.EntityManager
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface javax.persistence.EntityManager
      • joinTransaction

        public void joinTransaction()
        Specified by:
        joinTransaction in interface javax.persistence.EntityManager
      • lock

        public void lock​(java.lang.Object arg0,
                         javax.persistence.LockModeType arg1)
        Specified by:
        lock in interface javax.persistence.EntityManager
      • lock

        public void lock​(java.lang.Object arg0,
                         javax.persistence.LockModeType arg1,
                         java.util.Map<java.lang.String,​java.lang.Object> arg2)
        Specified by:
        lock in interface javax.persistence.EntityManager
      • merge

        public <T> T merge​(T arg0)
        Specified by:
        merge in interface javax.persistence.EntityManager
      • refresh

        public void refresh​(java.lang.Object arg0)
        Specified by:
        refresh in interface javax.persistence.EntityManager
      • refresh

        public void refresh​(java.lang.Object arg0,
                            java.util.Map<java.lang.String,​java.lang.Object> arg1)
        Specified by:
        refresh in interface javax.persistence.EntityManager
      • refresh

        public void refresh​(java.lang.Object arg0,
                            javax.persistence.LockModeType arg1)
        Specified by:
        refresh in interface javax.persistence.EntityManager
      • refresh

        public void refresh​(java.lang.Object arg0,
                            javax.persistence.LockModeType arg1,
                            java.util.Map<java.lang.String,​java.lang.Object> arg2)
        Specified by:
        refresh in interface javax.persistence.EntityManager
      • setFlushMode

        public void setFlushMode​(javax.persistence.FlushModeType arg0)
        Specified by:
        setFlushMode in interface javax.persistence.EntityManager
      • setProperty

        public void setProperty​(java.lang.String arg0,
                                java.lang.Object arg1)
        Specified by:
        setProperty in interface javax.persistence.EntityManager
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> arg0)
        Specified by:
        unwrap in interface javax.persistence.EntityManager
      • createEntityGraph

        public <T> javax.persistence.EntityGraph<T> createEntityGraph​(java.lang.Class<T> arg0)
        Specified by:
        createEntityGraph in interface javax.persistence.EntityManager
      • createEntityGraph

        public javax.persistence.EntityGraph<?> createEntityGraph​(java.lang.String arg0)
        Specified by:
        createEntityGraph in interface javax.persistence.EntityManager
      • createNamedStoredProcedureQuery

        public javax.persistence.StoredProcedureQuery createNamedStoredProcedureQuery​(java.lang.String arg0)
        Specified by:
        createNamedStoredProcedureQuery in interface javax.persistence.EntityManager
      • createQuery

        public javax.persistence.Query createQuery​(javax.persistence.criteria.CriteriaUpdate arg0)
        Specified by:
        createQuery in interface javax.persistence.EntityManager
      • createQuery

        public javax.persistence.Query createQuery​(javax.persistence.criteria.CriteriaDelete arg0)
        Specified by:
        createQuery in interface javax.persistence.EntityManager
      • createStoredProcedureQuery

        public javax.persistence.StoredProcedureQuery createStoredProcedureQuery​(java.lang.String arg0)
        Specified by:
        createStoredProcedureQuery in interface javax.persistence.EntityManager
      • createStoredProcedureQuery

        public javax.persistence.StoredProcedureQuery createStoredProcedureQuery​(java.lang.String arg0,
                                                                                 java.lang.Class... arg1)
        Specified by:
        createStoredProcedureQuery in interface javax.persistence.EntityManager
      • createStoredProcedureQuery

        public javax.persistence.StoredProcedureQuery createStoredProcedureQuery​(java.lang.String arg0,
                                                                                 java.lang.String... arg1)
        Specified by:
        createStoredProcedureQuery in interface javax.persistence.EntityManager
      • getEntityGraph

        public javax.persistence.EntityGraph<?> getEntityGraph​(java.lang.String arg0)
        Specified by:
        getEntityGraph in interface javax.persistence.EntityManager
      • getEntityGraphs

        public <T> java.util.List<javax.persistence.EntityGraph<? super T>> getEntityGraphs​(java.lang.Class<T> arg0)
        Specified by:
        getEntityGraphs in interface javax.persistence.EntityManager
      • isJoinedToTransaction

        public boolean isJoinedToTransaction()
        Specified by:
        isJoinedToTransaction in interface javax.persistence.EntityManager