Interface DatabaseExecutionJpaRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ScenarioExecutionEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<ScenarioExecutionEntity,,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<ScenarioExecutionEntity>,org.springframework.data.repository.ListCrudRepository<ScenarioExecutionEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<ScenarioExecutionEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<ScenarioExecutionEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<ScenarioExecutionEntity>,org.springframework.data.repository.Repository<ScenarioExecutionEntity,Long>
public interface DatabaseExecutionJpaRepository
extends org.springframework.data.jpa.repository.JpaRepository<ScenarioExecutionEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<ScenarioExecutionEntity>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T> -
Method Summary
Modifier and TypeMethodDescriptionfindAllByScenarioId(String scenarioId) findByScenarioIdOrderByIdDesc(String scenarioId) findByStatus(ServerReportStatus status) List<jakarta.persistence.Tuple> findLastByStatusAndScenariosIds(List<String> scenarioIds, ServerReportStatus status) Finds the last executions with the specified status if available, otherwise the last executions.getExecutionReportByIds(List<Long> executionsIds) Methods 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.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findAll, findBy, findOneMethods 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
-
findByStatus
-
findByScenarioIdOrderByIdDesc
-
findLastByStatusAndScenariosIds
@Query("SELECT\n CASE\n WHEN EXISTS (SELECT 1 FROM SCENARIO_EXECUTIONS se_tmp WHERE se_tmp.scenarioId = se.scenarioId AND se_tmp.status = :status)\n THEN MAX(CASE WHEN se.status = :status THEN se.id END)\n ELSE MAX(CASE WHEN se.status != \'NOT_EXECUTED\' THEN se.id END)\n END AS max_id,\n se.scenarioId\nFROM\n SCENARIO_EXECUTIONS se\nWHERE\n se.scenarioId IN :scenarioIds\nGROUP BY\n se.scenarioId\n") List<jakarta.persistence.Tuple> findLastByStatusAndScenariosIds(@Param("scenarioIds") List<String> scenarioIds, @Param("status") ServerReportStatus status) Finds the last executions with the specified status if available, otherwise the last executions.- Parameters:
scenarioIds- A list of scenario IDs to filter the executions by.status- The status to filter the executions by.- Returns:
- A list of tuples representing the last execution id and the scenario id.
-
findAllByScenarioId
-
getExecutionReportByIds
@Query(" select se from SCENARIO s, SCENARIO_EXECUTIONS_REPORTS ser\n inner join ser.scenarioExecution se\n where s.activated = true\n and cast(s.id as string) = se.scenarioId\n and ser.scenarioExecutionId in (:executionsIds)\n order by se.id desc\n") List<ScenarioExecutionEntity> getExecutionReportByIds(@Param("executionsIds") List<Long> executionsIds)
-