public interface JpaApplicationRepository extends JpaBaseRepository<ApplicationEntity>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIND_UNUSED_APPLICATIONS_QUERY
Find any application records where they are not linked to any jobs and it's not linked to any commands and was
created before the given time.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.Long> |
findUnusedApplications(java.time.Instant createdThreshold,
int limit)
Delete any application records where it's not linked to any jobs and it's not linked to any commands and was
created before the given time.
|
java.util.Optional<ApplicationEntity> |
getApplicationAndCommands(java.lang.String id)
Get the
ApplicationEntity but eagerly fetch all command base information as well. |
java.util.Optional<ApplicationEntity> |
getApplicationAndCommandsDto(java.lang.String id)
Get the
ApplicationEntity but eagerly fetch all command DTO information as well. |
java.util.Optional<ApplicationEntity> |
getApplicationDto(java.lang.String id)
Get the
ApplicationEntity but eagerly fetch all relational information needed to construct a DTO. |
deleteByIdIn, existsByUniqueId, findByUniqueId, findByUniqueIddeleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlushfindAllcount, delete, deleteAll, deleteAll, deleteById, existsById, findById, savestatic final java.lang.String FIND_UNUSED_APPLICATIONS_QUERY
@Query(value="SELECT id FROM applications WHERE created < :createdThreshold AND id NOT IN (SELECT DISTINCT(application_id) FROM commands_applications) AND id NOT IN (SELECT DISTINCT(application_id) FROM jobs_applications) LIMIT :limit",
nativeQuery=true)
java.util.Set<java.lang.Long> findUnusedApplications(@Param(value="createdThreshold")
java.time.Instant createdThreshold,
@Param(value="limit")
int limit)
createdThreshold - The instant in time before which records should be considered for deletion. Exclusive.limit - Maximum number of IDs to return@Query(value="SELECT a FROM ApplicationEntity a WHERE a.uniqueId = :id")
@EntityGraph(value="Application.dto",
type=LOAD)
java.util.Optional<ApplicationEntity> getApplicationDto(@Param(value="id")
java.lang.String id)
ApplicationEntity but eagerly fetch all relational information needed to construct a DTO.id - The unique identifier of the application to getApplicationEntity with dto data loaded or Optional.empty() if no application with the
given id exists@Query(value="SELECT a FROM ApplicationEntity a WHERE a.uniqueId = :id")
@EntityGraph(value="Application.commands",
type=LOAD)
java.util.Optional<ApplicationEntity> getApplicationAndCommands(@Param(value="id")
java.lang.String id)
ApplicationEntity but eagerly fetch all command base information as well.id - The unique identifier of the application to getApplicationEntity with command data loaded or Optional.empty() if no application with
the given id exists@Query(value="SELECT a FROM ApplicationEntity a WHERE a.uniqueId = :id")
@EntityGraph(value="Application.commands.dto",
type=LOAD)
java.util.Optional<ApplicationEntity> getApplicationAndCommandsDto(@Param(value="id")
java.lang.String id)
ApplicationEntity but eagerly fetch all command DTO information as well.id - The unique identifier of the application to getApplicationEntity with command data loaded or Optional.empty() if no application with
the given id exists