JavaPersistenceHandler (training-module-library 1.0.0-4.12.0-163223 API)
Date: 2018-07-19

org.gcube.portal.trainingmodule.database

## Interface JavaPersistenceHandler<T>

- Type Parameters:
    `T` - the generic type
  All Known Implementing Classes:
    AbstractPersistence, TrainingProgressUnitPersistence, TrainingProjectPersistence, TrainingUnitPersistence

      public interface JavaPersistenceHandler<T>

  The Interface JavaPersistenceHandler.
  Author:
    Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jan 10, 2018

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.persistence.EntityManager` | `createNewManager()` Creates the new manager.
    `List<T>` | `executeCriteriaQuery(javax.persistence.criteria.CriteriaQuery<Object> criteriaQuery)` Execute criteria query.
    `List<T>` | `executeTypedQuery(javax.persistence.criteria.CriteriaQuery<Object> cq, int startIndex, int offset)` Execute typed query.
    `javax.persistence.criteria.CriteriaBuilder` | `getCriteriaBuilder()` Gets the criteria builder.
    `javax.persistence.EntityManagerFactory` | `getEntityManagerFactory()` Gets the entity manager factory.
    `javax.persistence.criteria.Root<T>` | `rootFrom(javax.persistence.criteria.CriteriaQuery<Object> cq)` Root from.

- - ### Method Detail

    - #### getCriteriaBuilder

          javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
                                                                 throws DatabaseServiceException

      Gets the criteria builder.
      Returns:
        the criteria builder
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### getEntityManagerFactory

          javax.persistence.EntityManagerFactory getEntityManagerFactory()

      Gets the entity manager factory.
      Returns:
        the entity manager factory

    - #### createNewManager

          javax.persistence.EntityManager createNewManager()
                                                    throws DatabaseServiceException

      Creates the new manager.
      Returns:
        the entity manager
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### executeCriteriaQuery

          List<T> executeCriteriaQuery(javax.persistence.criteria.CriteriaQuery<Object> criteriaQuery)
                                throws DatabaseServiceException

      Execute criteria query.
      Parameters:
        `criteriaQuery` - the criteria query
      Returns:
        the list
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### executeTypedQuery

          List<T> executeTypedQuery(javax.persistence.criteria.CriteriaQuery<Object> cq,
                                    int startIndex,
                                    int offset)
                             throws DatabaseServiceException

      Execute typed query.
      Parameters:
        `cq` - the cq
        `startIndex` - the start index
        `offset` - the offset
      Returns:
        the list
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### rootFrom

          javax.persistence.criteria.Root<T> rootFrom(javax.persistence.criteria.CriteriaQuery<Object> cq)

      Root from.
      Parameters:
        `cq` - the cq
      Returns:
        the root

Copyright © 2018. All Rights Reserved.