Interface BusinessDataRepository

  • All Superinterfaces:
    LifecycleService, TenantLifecycleService
    All Known Implementing Classes:
    JPABusinessDataRepositoryImpl

    public interface BusinessDataRepository
    extends TenantLifecycleService
    The BusinessDataRepository service allows to manage Business Data operations. It includes deploy / undeploy of a Business Data Model, search / find / create / update of Business Data entity objects.
    Author:
    Matthieu Chaffotte, Emmanuel Duchastenier
    See Also:
    Entity
    • Method Summary

      All Methods Instance Methods Abstract 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.
      <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)  
      <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.
      org.bonitasoft.engine.bdm.Entity merge​(org.bonitasoft.engine.bdm.Entity entity)
      Reconnect the given entity with the persistence unit
      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.
      org.bonitasoft.engine.bdm.Entity unwrap​(org.bonitasoft.engine.bdm.Entity wrapped)
      Unwraps the Entity if necessary.
    • Method Detail

      • findById

        <T extends org.bonitasoft.engine.bdm.Entity> T findById​(java.lang.Class<T> entityClass,
                                                                java.lang.Long primaryKey)
                                                         throws SBusinessDataNotFoundException
        Finds an Entity that is defined in a deployed Business Data Model.
        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

        <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. If a primary key does not match an existing entity no exception is thrown and nothing is added in the list.
        Parameters:
        entityClass - the class of the entity to search for.
        primaryKeys - the primary keys.
        Returns:
        the list of found entities
      • findByIdentifiers

        <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. If a primary key does not match an existing entity no exception is thrown and nothing is added in the list.
        Parameters:
        entityClass - the class of the entity to search for.
        primaryKeys - the primary keys.
        Returns:
        the list of found entities
      • find

        <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
        Finds an Entity that is defined in a deployed Business Data Model, through JPQL query.
        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:
        SBusinessDataNotFoundException - if the Business Data could not be found with the provided primary key.
        NonUniqueResultException - if more than one result was found.
      • findList

        <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)
      • findByNamedQuery

        <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)
                                                     throws NonUniqueResultException
        Throws:
        NonUniqueResultException
      • findListByNamedQuery

        <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)
      • persist

        void persist​(org.bonitasoft.engine.bdm.Entity entity)
        Saves or updates an entity in the Business Data Repository.
        Parameters:
        entity - the entity to save / update.
      • remove

        void remove​(org.bonitasoft.engine.bdm.Entity entity)
        Removes an entity from the Business Data Repository.
        Parameters:
        entity - the entity to remove.
      • merge

        org.bonitasoft.engine.bdm.Entity merge​(org.bonitasoft.engine.bdm.Entity entity)
        Reconnect the given entity with the persistence unit
        Parameters:
        entity - the entity to reconnect.
        Returns:
        the connected entity.
      • getEntityClassNames

        java.util.Set<java.lang.String> getEntityClassNames()
        Retrieves the Set of known Entity class names in this Business Data Repository.
        Returns:
        the Set of known Entity class names, as qualified class names.
      • unwrap

        org.bonitasoft.engine.bdm.Entity unwrap​(org.bonitasoft.engine.bdm.Entity wrapped)
        Unwraps the Entity if necessary.
        Parameters:
        wrapped - the potential wrapped entity
        Returns:
        the unwrapped entity