Skip to content

Commit

Permalink
chore: resolve nested scenario execution entities
Browse files Browse the repository at this point in the history
since the relation of `ScenarioExecution` to `TestResult` is now 1 to 1,
we can simply fetch this with all `Message` entities.
  • Loading branch information
bbortt committed May 22, 2024
1 parent 1557b03 commit 554440d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ default Page<Message> findAllWithEagerRelationships(Pageable pageable) {
Optional<Message> findOneWithToOneRelationships(@Param("messageId") Long messageId);

@Override
@EntityGraph(attributePaths = {"headers", "scenarioExecution"})
@EntityGraph(attributePaths = {"headers", "scenarioExecution", "scenarioExecution.testResult"})
Page<Message> findAll(Specification<Message> spec, Pageable pageable);

default List<Message> findAllForScenarioExecution(Long scenarioExecutionId, String citrusMessageId, Message.Direction direction) {
Expand All @@ -63,6 +63,6 @@ default List<Message> findAllForScenarioExecution(Long scenarioExecutionId, Stri
List<Message> findAllByScenarioExecutionExecutionIdEqualsAndCitrusMessageIdEqualsIgnoreCaseAndDirectionEquals(@Param("scenarioExecutionId") Long scenarioExecutionId, @Param("citrusMessageId") String citrusMessageId, @Param("direction") Integer direction);

@Query("FROM Message WHERE messageId IN :messageIds")
@EntityGraph(attributePaths = {"headers", "scenarioExecution"})
@EntityGraph(attributePaths = {"headers", "scenarioExecution", "scenarioExecution.testResult"})
Page<Message> findAllWhereMessageIdIn(@Param("messageIds") List<Long> messageIds, Pageable pageable);
}

0 comments on commit 554440d

Please sign in to comment.