Package org.silverpeas.components.resourcesmanager.repository

## Class ReservedResourceJpaRepository

- java.lang.Object
- - org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository<E>
  - - org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<ReservedResource>
    - - org.silverpeas.components.resourcesmanager.repository.ReservedResourceJpaRepository

- All Implemented Interfaces:
    `ReservedResourceRepository`, `org.silverpeas.core.persistence.datasource.repository.EntityRepository<ReservedResource>`, `org.silverpeas.core.persistence.datasource.repository.WithSaveAndFlush<ReservedResource>`

      @Repository
      public class ReservedResourceJpaRepository
      extends org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<ReservedResource>
      implements ReservedResourceRepository

  Author:
    ebonnet

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ReservedResourceJpaRepository()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `deleteAllReservedResourcesForReservation​(Long currentReservationId)` |
    `void` | `deleteAllReservedResourcesForResource​(Long currentResourceId)` |
    `long` | `deleteByComponentInstanceId​(String instanceId)` | Deletes all entities belonging to the specified component instance.
    `List<ReservedResource>` | `findAllReservedResourcesForReservation​(Long currentReservationId)` |
    `List<ReservedResource>` | `findAllReservedResourcesOfReservation​(Long currentReservationId)` |
    `List<ReservedResource>` | `findAllReservedResourcesWithProblem​(Long currentReservationId, List<Long> futureReservedResourceIds, String startPeriod, String endPeriod)` |

    - ### Methods inherited from class org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository

      `saveAndFlush`

    - ### Methods inherited from class org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository

      `contains, countByCriteria, countFromJpqlString, delete, deleteById, deleteFromJpqlQuery, deleteFromNamedQuery, findByCriteria, findByNamedQuery, findFirstByNamedQuery, flush, getAll, getById, getById, getEntityClass, getEntityManager, getFromJpqlString, getFromJpqlString, getFromNamedQuery, getFromNamedQuery, getIdentifierConverter, getMaximumItemsInClause, listFromJpqlString, listFromJpqlString, listFromJpqlString, listFromJpqlString, listFromNamedQuery, listFromNamedQuery, newNamedParameters, noParameter, save, setMaximumItemsInClause, split, streamByNamedQuery, streamByNamedQuery, streamFromJpqlString, streamFromJpqlString, updateFromJpqlQuery, updateFromNamedQuery`

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

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

    - ### Methods inherited from interface org.silverpeas.core.persistence.datasource.repository.EntityRepository

      `contains, delete, delete, deleteById, deleteById, findByCriteria, flush, getAll, getById, getById, getById, save, save, save`

    - ### Methods inherited from interface org.silverpeas.core.persistence.datasource.repository.WithSaveAndFlush

      `saveAndFlush`

- - ### Constructor Detail

    - #### ReservedResourceJpaRepository

          public ReservedResourceJpaRepository()

  - ### Method Detail

    - #### findAllReservedResourcesWithProblem

          public List<ReservedResource> findAllReservedResourcesWithProblem​(Long currentReservationId,
                                                                            List<Long> futureReservedResourceIds,
                                                                            String startPeriod,
                                                                            String endPeriod)

      Specified by:
        `findAllReservedResourcesWithProblem` in interface `ReservedResourceRepository`

    - #### findAllReservedResourcesForReservation

          public List<ReservedResource> findAllReservedResourcesForReservation​(Long currentReservationId)

      Specified by:
        `findAllReservedResourcesForReservation` in interface `ReservedResourceRepository`

    - #### deleteAllReservedResourcesForReservation

          public void deleteAllReservedResourcesForReservation​(Long currentReservationId)

      Specified by:
        `deleteAllReservedResourcesForReservation` in interface `ReservedResourceRepository`

    - #### deleteAllReservedResourcesForResource

          public void deleteAllReservedResourcesForResource​(Long currentResourceId)

      Specified by:
        `deleteAllReservedResourcesForResource` in interface `ReservedResourceRepository`

    - #### findAllReservedResourcesOfReservation

          public List<ReservedResource> findAllReservedResourcesOfReservation​(Long currentReservationId)

      Specified by:
        `findAllReservedResourcesOfReservation` in interface `ReservedResourceRepository`

    - #### deleteByComponentInstanceId

          public long deleteByComponentInstanceId​(String instanceId)

      Deletes all entities belonging to the specified component instance.
      Specified by:
        `deleteByComponentInstanceId` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<ReservedResource>`
      Overrides:
        `deleteByComponentInstanceId` in class `org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<ReservedResource>`
      Parameters:
        `instanceId` - the unique instance identifier.
      Returns:
        the number of deleted entities.