Class JPABusinessDataRepositoryImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends java.io.Serializable>
      T
      find​(java.lang.Class<T> resultClass, java.lang.String jpqlQuery, java.util.Map<java.lang.String,​java.io.Serializable> parameters)
      Finds an Entity that is defined in a deployed Business Data Model, through JPQL query.
      protected <T extends java.io.Serializable>
      T
      find​(java.lang.Class<T> resultClass, javax.persistence.TypedQuery<T> query, java.util.Map<java.lang.String,​java.io.Serializable> parameters)  
      <T extends org.bonitasoft.engine.bdm.Entity>
      T
      findById​(java.lang.Class<T> entityClass, java.lang.Long primaryKey)
      Finds an Entity that is defined in a deployed Business Data Model.
      <T extends org.bonitasoft.engine.bdm.Entity>
      java.util.List<T>
      findByIdentifiers​(java.lang.Class<T> entityClass, java.util.List<java.lang.Long> primaryKeys)
      Finds (well-loaded) entities that is defined in a deployed Business Data Model.
      <T extends org.bonitasoft.engine.bdm.Entity>
      java.util.List<T>
      findByIds​(java.lang.Class<T> entityClass, java.util.List<java.lang.Long> primaryKeys)
      Finds entities that is defined in a deployed Business Data Model.
      <T extends java.io.Serializable>
      T
      findByNamedQuery​(java.lang.String queryName, java.lang.Class<T> resultClass, java.util.Map<java.lang.String,​java.io.Serializable> parameters)  
      <T extends java.io.Serializable>
      java.util.List<T>
      findList​(java.lang.Class<T> resultClass, java.lang.String jpqlQuery, java.util.Map<java.lang.String,​java.io.Serializable> parameters, int startIndex, int maxResults)  
      protected <T extends java.io.Serializable>
      java.util.List<T>
      findList​(javax.persistence.TypedQuery<T> query, java.util.Map<java.lang.String,​java.io.Serializable> parameters, int startIndex, int maxResults)  
      <T extends java.io.Serializable>
      java.util.List<T>
      findListByNamedQuery​(java.lang.String queryName, java.lang.Class<T> resultClass, java.util.Map<java.lang.String,​java.io.Serializable> parameters, int startIndex, int maxResults)  
      java.util.Set<java.lang.String> getEntityClassNames()
      Retrieves the Set of known Entity class names in this Business Data Repository.
      protected javax.persistence.EntityManager getEntityManager()  
      javax.persistence.EntityManagerFactory getEntityManagerFactory()  
      org.bonitasoft.engine.bdm.Entity merge​(org.bonitasoft.engine.bdm.Entity entity)
      Reconnect the given entity with the persistence unit
      void onUpdate​(java.lang.ClassLoader newClassLoader)  
      void pause()
      Temporary halt the execution of this service.
      void persist​(org.bonitasoft.engine.bdm.Entity entity)
      Saves or updates an entity in the Business Data Repository.
      void remove​(org.bonitasoft.engine.bdm.Entity entity)
      Removes an entity from the Business Data Repository.
      void resume()
      resume the execution the service
      void start()
      Start the service
      void stop()  
      org.bonitasoft.engine.bdm.Entity unwrap​(org.bonitasoft.engine.bdm.Entity wrapped)
      Unwraps the Entity if necessary.
      • Methods inherited from class java.lang.Object

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

      • getEntityManagerFactory

        public javax.persistence.EntityManagerFactory getEntityManagerFactory()
      • getEntityClassNames

        public java.util.Set<java.lang.String> getEntityClassNames()
        Description copied from interface: BusinessDataRepository
        Retrieves the Set of known Entity class names in this Business Data Repository.
        Specified by:
        getEntityClassNames in interface BusinessDataRepository
        Returns:
        the Set of known Entity class names, as qualified class names.
      • getEntityManager

        protected javax.persistence.EntityManager getEntityManager()
      • findById

        public <T extends org.bonitasoft.engine.bdm.Entity> T findById​(java.lang.Class<T> entityClass,
                                                                       java.lang.Long primaryKey)
                                                                throws SBusinessDataNotFoundException
        Description copied from interface: BusinessDataRepository
        Finds an Entity that is defined in a deployed Business Data Model.
        Specified by:
        findById in interface BusinessDataRepository
        Parameters:
        entityClass - the class of the entity to search for.
        primaryKey - the primary key to search by.
        Returns:
        the found entity, if any.
        Throws:
        SBusinessDataNotFoundException - if the Business Data could not be found with the provided primary key.
      • findByIds

        public <T extends org.bonitasoft.engine.bdm.Entity> java.util.List<T> findByIds​(java.lang.Class<T> entityClass,
                                                                                        java.util.List<java.lang.Long> primaryKeys)
        Description copied from interface: BusinessDataRepository
        Finds entities that is defined in a deployed Business Data Model. If a primary key does not match an existing entity no exception is thrown and nothing is added in the list.
        Specified by:
        findByIds in interface BusinessDataRepository
        Parameters:
        entityClass - the class of the entity to search for.
        primaryKeys - the primary keys.
        Returns:
        the list of found entities
      • findByIdentifiers

        public <T extends org.bonitasoft.engine.bdm.Entity> java.util.List<T> findByIdentifiers​(java.lang.Class<T> entityClass,
                                                                                                java.util.List<java.lang.Long> primaryKeys)
        Description copied from interface: BusinessDataRepository
        Finds (well-loaded) entities that is defined in a deployed Business Data Model. If a primary key does not match an existing entity no exception is thrown and nothing is added in the list.
        Specified by:
        findByIdentifiers in interface BusinessDataRepository
        Parameters:
        entityClass - the class of the entity to search for.
        primaryKeys - the primary keys.
        Returns:
        the list of found entities
      • find

        protected <T extends java.io.Serializable> T find​(java.lang.Class<T> resultClass,
                                                          javax.persistence.TypedQuery<T> query,
                                                          java.util.Map<java.lang.String,​java.io.Serializable> parameters)
                                                   throws NonUniqueResultException
        Throws:
        NonUniqueResultException
      • find

        public <T extends java.io.Serializable> T find​(java.lang.Class<T> resultClass,
                                                       java.lang.String jpqlQuery,
                                                       java.util.Map<java.lang.String,​java.io.Serializable> parameters)
                                                throws NonUniqueResultException
        Description copied from interface: BusinessDataRepository
        Finds an Entity that is defined in a deployed Business Data Model, through JPQL query.
        Specified by:
        find in interface BusinessDataRepository
        Parameters:
        resultClass - the class of the entity to search for.
        jpqlQuery - the JPQL query string to search the entity.
        parameters - the parameters needed to execute the query.
        Returns:
        the found entity, if any.
        Throws:
        NonUniqueResultException - if more than one result was found.
      • findList

        public <T extends java.io.Serializable> java.util.List<T> findList​(java.lang.Class<T> resultClass,
                                                                           java.lang.String jpqlQuery,
                                                                           java.util.Map<java.lang.String,​java.io.Serializable> parameters,
                                                                           int startIndex,
                                                                           int maxResults)
        Specified by:
        findList in interface BusinessDataRepository
      • findListByNamedQuery

        public <T extends java.io.Serializable> java.util.List<T> findListByNamedQuery​(java.lang.String queryName,
                                                                                       java.lang.Class<T> resultClass,
                                                                                       java.util.Map<java.lang.String,​java.io.Serializable> parameters,
                                                                                       int startIndex,
                                                                                       int maxResults)
        Specified by:
        findListByNamedQuery in interface BusinessDataRepository
      • findList

        protected <T extends java.io.Serializable> java.util.List<T> findList​(javax.persistence.TypedQuery<T> query,
                                                                              java.util.Map<java.lang.String,​java.io.Serializable> parameters,
                                                                              int startIndex,
                                                                              int maxResults)
      • remove

        public void remove​(org.bonitasoft.engine.bdm.Entity entity)
        Description copied from interface: BusinessDataRepository
        Removes an entity from the Business Data Repository.
        Specified by:
        remove in interface BusinessDataRepository
        Parameters:
        entity - the entity to remove.
      • persist

        public void persist​(org.bonitasoft.engine.bdm.Entity entity)
        Description copied from interface: BusinessDataRepository
        Saves or updates an entity in the Business Data Repository.
        Specified by:
        persist in interface BusinessDataRepository
        Parameters:
        entity - the entity to save / update.
      • merge

        public org.bonitasoft.engine.bdm.Entity merge​(org.bonitasoft.engine.bdm.Entity entity)
        Description copied from interface: BusinessDataRepository
        Reconnect the given entity with the persistence unit
        Specified by:
        merge in interface BusinessDataRepository
        Parameters:
        entity - the entity to reconnect.
        Returns:
        the connected entity.
      • unwrap

        public org.bonitasoft.engine.bdm.Entity unwrap​(org.bonitasoft.engine.bdm.Entity wrapped)
        Description copied from interface: BusinessDataRepository
        Unwraps the Entity if necessary.
        Specified by:
        unwrap in interface BusinessDataRepository
        Parameters:
        wrapped - the potential wrapped entity
        Returns:
        the unwrapped entity