-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: scenario execution read-only rest api
- Loading branch information
Showing
63 changed files
with
2,919 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 33 additions & 1 deletion
34
...tor-starter/src/main/java/org/citrusframework/simulator/repository/MessageRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,44 @@ | ||
package org.citrusframework.simulator.repository; | ||
|
||
import org.citrusframework.simulator.model.Message; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Spring Data JPA repository for the {@link Message} entity. | ||
*/ | ||
@Repository | ||
public interface MessageRepository extends JpaRepository<Message, Long>, JpaSpecificationExecutor<Message> {} | ||
public interface MessageRepository extends JpaRepository<Message, Long>, JpaSpecificationExecutor<Message> { | ||
|
||
default Optional<Message> findOneWithEagerRelationships(Long id) { | ||
return this.findOneWithToOneRelationships(id); | ||
} | ||
|
||
default List<Message> findAllWithEagerRelationships() { | ||
return this.findAllWithToOneRelationships(); | ||
} | ||
|
||
default Page<Message> findAllWithEagerRelationships(Pageable pageable) { | ||
return this.findAllWithToOneRelationships(pageable); | ||
} | ||
|
||
@Query( | ||
value = "select message from Message message left join fetch message.scenarioExecution", | ||
countQuery = "select count(message) from Message message" | ||
) | ||
Page<Message> findAllWithToOneRelationships(Pageable pageable); | ||
|
||
@Query("select message from Message message left join fetch message.scenarioExecution") | ||
List<Message> findAllWithToOneRelationships(); | ||
|
||
@Query("select message from Message message left join fetch message.scenarioExecution where message.id =:id") | ||
Optional<Message> findOneWithToOneRelationships(@Param("id") Long id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.