Interface OrderRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ProcessingOrder,Long>, org.springframework.data.jpa.repository.JpaRepository<ProcessingOrder,Long>, org.springframework.data.repository.ListCrudRepository<ProcessingOrder,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<ProcessingOrder,Long>, org.springframework.data.repository.PagingAndSortingRepository<ProcessingOrder,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<ProcessingOrder>, org.springframework.data.repository.Repository<ProcessingOrder,Long>

@Transactional public interface OrderRepository extends org.springframework.data.jpa.repository.JpaRepository<ProcessingOrder,Long>
Data Access Object for the ProcessingOrder class
Author:
Dr. Thomas Bassler
  • Method Summary

    Modifier and Type
    Method
    Description
    findByExecutionTimeBetween(Instant executionTimeFrom, Instant executionTimeTo)
    Get all processing orders scheduled for execution within the given time range
    findByMissionCodeAndIdentifier(String missionCode, String identifier)
    Get the processing order with the given mission code and identifier
    Get the latest execution time of processing orders with the given mission code and identifier pattern
    Get the processing order with the given order state
    Get all processing orders of state orderState and eviction time older (less) than evictionTime
    Get the processing order with the given UUID
    Get the IDs of all processing orders of state orderState and eviction time older (less) than evictionTime

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByMissionCodeAndIdentifierAndLatestExecutionTime

      @Query("select distinct(po.executionTime) from ProcessingOrder po where po.mission.code = ?1 and po.identifier like ?2 and po.executionTime = (select distinct(max(po2.executionTime)) from ProcessingOrder po2 where po2.mission.code = ?1 and po2.identifier like ?2)") Date findByMissionCodeAndIdentifierAndLatestExecutionTime(String missionCode, String identifier)
      Get the latest execution time of processing orders with the given mission code and identifier pattern
      Parameters:
      missionCode - the mission code of the processing order
      identifier - the identifier of the processing order
      Returns:
      the unique execution time of processing orders identified by the given identifier pattern
    • findByMissionCodeAndIdentifier

      @Query("select po from ProcessingOrder po where po.mission.code = ?1 and po.identifier = ?2") ProcessingOrder findByMissionCodeAndIdentifier(String missionCode, String identifier)
      Get the processing order with the given mission code and identifier
      Parameters:
      missionCode - the mission code of the processing order
      identifier - the identifier of the processing order
      Returns:
      the unique processing order identified by the given identifier
    • findByUuid

      ProcessingOrder findByUuid(UUID uuid)
      Get the processing order with the given UUID
      Parameters:
      uuid - the UUID of the processing order
      Returns:
      the unique processing order identified by the given UUID
    • findByExecutionTimeBetween

      List<ProcessingOrder> findByExecutionTimeBetween(Instant executionTimeFrom, Instant executionTimeTo)
      Get all processing orders scheduled for execution within the given time range
      Parameters:
      executionTimeFrom - the earliest execution time
      executionTimeTo - the latest execution time
      Returns:
      a list of processing orders matching the selection criteria
    • findByOrderStateAndEvictionTimeLessThan

      @Query("select p from ProcessingOrder p where p.orderState = ?1 and p.evictionTime is not null and p.evictionTime < ?2") List<ProcessingOrder> findByOrderStateAndEvictionTimeLessThan(OrderState orderState, Instant evictionTime)
      Get all processing orders of state orderState and eviction time older (less) than evictionTime
      Parameters:
      orderState - the state of order
      evictionTime - the time to compare
      Returns:
      a list of processing orders matching the selection criteria
    • findIdsByOrderStateAndEvictionTimeLessThan

      @Query("select p.id from ProcessingOrder p where p.orderState = ?1 and p.evictionTime is not null and p.evictionTime < ?2") List<Long> findIdsByOrderStateAndEvictionTimeLessThan(OrderState orderState, Instant evictionTime)
      Get the IDs of all processing orders of state orderState and eviction time older (less) than evictionTime
      Parameters:
      orderState - the state of order
      evictionTime - the time to compare
      Returns:
      a list of database IDs for processing orders matching the selection criteria
    • findByOrderState

      @Query("select po from ProcessingOrder po where po.orderState = ?1") List<ProcessingOrder> findByOrderState(OrderState orderState)
      Get the processing order with the given order state
      Parameters:
      orderState - the state of order
      Returns:
      the unique processing order identified by the given identifier