Package de.dlr.proseo.model.dao
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 TypeMethodDescriptionfindByExecutionTimeBetween(Instant executionTimeFrom, Instant executionTimeTo) Get all processing orders scheduled for execution within the given time rangefindByMissionCodeAndIdentifier(String missionCode, String identifier) Get the processing order with the given mission code and identifierfindByMissionCodeAndIdentifierAndLatestExecutionTime(String missionCode, String identifier) Get the latest execution time of processing orders with the given mission code and identifier patternfindByOrderState(OrderState orderState) Get the processing order with the given order statefindByOrderStateAndEvictionTimeLessThan(OrderState orderState, Instant evictionTime) Get all processing orders of state orderState and eviction time older (less) than evictionTimefindByUuid(UUID uuid) Get the processing order with the given UUIDfindIdsByOrderStateAndEvictionTimeLessThan(OrderState orderState, Instant evictionTime) Get the IDs of all processing orders of state orderState and eviction time older (less) than evictionTimeMethods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods 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 orderidentifier- 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 orderidentifier- the identifier of the processing order- Returns:
- the unique processing order identified by the given identifier
-
findByUuid
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 timeexecutionTimeTo- 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 orderevictionTime- 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 orderevictionTime- 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
-