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

org.gcube.portal.trainingmodule.persistence

## Class TrainingUnitPersistence

- java.lang.Object
- - org.gcube.portal.trainingmodule.persistence.AbstractPersistence<TrainingUnit>
  - - org.gcube.portal.trainingmodule.persistence.TrainingUnitPersistence

- All Implemented Interfaces:
    Serializable, DaoUpdater<TrainingUnit>, DaoViewer<TrainingUnit>, JavaPersistenceHandler<TrainingUnit>

      public class TrainingUnitPersistence
      extends AbstractPersistence<TrainingUnit>
      implements Serializable

  The Class TrainingUnitPersistence.
  Author:
    Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jan 12, 2018
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.gcube.portal.trainingmodule.persistence.AbstractPersistence

      `AbstractPersistence.SQL_ORDER`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `logger` The logger.
    `static String` | `tableName` The Constant tableName.

    - ### Fields inherited from class org.gcube.portal.trainingmodule.persistence.AbstractPersistence

      `AND, entityManagerFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrainingUnitPersistence(javax.persistence.EntityManagerFactory factory)` Instantiates a new release persistence.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `deleteUnitsForTrainingProject(TrainingProject project)` Delete units for training project.
    `List<TrainingUnit>` | `getListUnitForTrainingProject(TrainingProject project)` Gets the list unit for training project.
    `List<TrainingUnit>` | `getTrainingUnitForInternalID(int internalID)` Gets the training unit for internal ID.
    `javax.persistence.criteria.Root<TrainingUnit>` | `rootFrom(javax.persistence.criteria.CriteriaQuery<Object> cq)` Root from.
    `TrainingUnit` | `updateTrainingUnitInfo(TrainingUnit training)` Update training unit info.

    - ### Methods inherited from class org.gcube.portal.trainingmodule.persistence.AbstractPersistence

      `countItems, create, createNewManager, deleteItemByInternalId, executeCriteriaQuery, executeTypedQuery, getCriteriaBuilder, getEntityManagerFactory, getItemByKey, getItemForInternalID, getRows, getRows, getRowsFiltered, getRowsOrdered, insert, remove, removeAll, update`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### tableName

          public static final String tableName

      The Constant tableName.

    - #### logger

          protected static org.slf4j.Logger logger

      The logger.

  - ### Constructor Detail

    - #### TrainingUnitPersistence

          public TrainingUnitPersistence(javax.persistence.EntityManagerFactory factory)

      Instantiates a new release persistence.
      Parameters:
        `factory` - the factory

  - ### Method Detail

    - #### rootFrom

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

      Description copied from interface: `JavaPersistenceHandler`
      Root from.
      Specified by:
        `rootFrom` in interface `JavaPersistenceHandler<TrainingUnit>`
      Specified by:
        `rootFrom` in class `AbstractPersistence<TrainingUnit>`
      Parameters:
        `cq` - the cq
      Returns:
        the root

    - #### getTrainingUnitForInternalID

          public List<TrainingUnit> getTrainingUnitForInternalID(int internalID)
                                                          throws DatabaseServiceException

      Gets the training unit for internal ID.
      Parameters:
        `internalID` - the internal ID
      Returns:
        the training unit for internal ID
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### updateTrainingUnitInfo

          public TrainingUnit updateTrainingUnitInfo(TrainingUnit training)
                                              throws DatabaseServiceException

      Update training unit info.
      Parameters:
        `training` - the training
      Returns:
        the training unit
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### deleteUnitsForTrainingProject

          public int deleteUnitsForTrainingProject(TrainingProject project)
                                            throws DatabaseServiceException

      Delete units for training project.
      Parameters:
        `project` - the project
      Returns:
        the int
      Throws:
        `DatabaseServiceException` - the database service exception

    - #### getListUnitForTrainingProject

          public List<TrainingUnit> getListUnitForTrainingProject(TrainingProject project)
                                                           throws DatabaseServiceException

      Gets the list unit for training project.
      Parameters:
        `project` - the project
      Returns:
        the list unit for training project
      Throws:
        `DatabaseServiceException` - the database service exception

Copyright © 2018. All Rights Reserved.