Package eu.dnetlib.app.directindex.repo
Interface PendingActionRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<PendingAction,,String> org.springframework.data.jpa.repository.JpaRepository<PendingAction,,String> org.springframework.data.repository.PagingAndSortingRepository<PendingAction,,String> org.springframework.data.repository.query.QueryByExampleExecutor<PendingAction>,org.springframework.data.repository.Repository<PendingAction,String>
@Repository
public interface PendingActionRepository
extends org.springframework.data.jpa.repository.JpaRepository<PendingAction,String>
-
Method Summary
Modifier and TypeMethodDescriptionlonglonglongcountByOperation(OperationType operation) longvoiddeleteByCreationDateBefore(LocalDateTime datatime) voiddeleteObsoleteRecords(int maxNumberOfDays) voidvoidvoidresetExecutionsForAllTypes(LocalDateTime dt, String dsId) voidresetExecutionsForType(LocalDateTime dt, String dsId, String type) 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, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods 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
-
findInsertOrUpdateOperations
@Query(value="select * from pending_actions where execution_date is null and (upper(operation) = \'INSERT\' or upper(operation) = \'UPDATE\')", nativeQuery=true) List<PendingAction> findInsertOrUpdateOperations() -
findDeleteOperations
@Query(value="select * from pending_actions where execution_date is null and upper(operation) = \'DELETE\'", nativeQuery=true) List<PendingAction> findDeleteOperations() -
deleteByCreationDateBefore
-
resetAllExecutions
@Modifying @Query(value="update pending_actions set execution_date = null", nativeQuery=true) void resetAllExecutions() -
resetExecutionsForAllTypes
@Modifying @Query(value="update pending_actions set execution_date = null where creation_date > ? and body::::jsonb->>\'collectedFromId\'::::text = ?", nativeQuery=true) void resetExecutionsForAllTypes(LocalDateTime dt, String dsId) -
resetExecutionsForType
@Modifying @Query(value="update pending_actions set execution_date = null where creation_date > ? and body::::jsonb->>\'collectedFromId\'::::text = ? and type = ?", nativeQuery=true) void resetExecutionsForType(LocalDateTime dt, String dsId, String type) -
resetExecutionForId
@Modifying @Query(value="update pending_actions set execution_date = null where id = ?", nativeQuery=true) void resetExecutionForId(String id) -
countByExecutionDateIsNull
long countByExecutionDateIsNull() -
countByOperation
-
countByOperationAndExecutionDateIsNull
-
findMinCreationDate
@Query(value="select min(creation_date) from pending_actions", nativeQuery=true) LocalDateTime findMinCreationDate() -
findMaxCreationDate
@Query(value="select max(creation_date) from pending_actions", nativeQuery=true) LocalDateTime findMaxCreationDate() -
findMinExecutionDate
@Query(value="select min(execution_date) from pending_actions", nativeQuery=true) LocalDateTime findMinExecutionDate() -
findMaxExecutionDate
@Query(value="select max(execution_date) from pending_actions", nativeQuery=true) LocalDateTime findMaxExecutionDate() -
countByErrorIsNotNull
long countByErrorIsNotNull() -
deleteObsoleteRecords
@Modifying @Query(value="delete from pending_actions where EXTRACT(DAY from now()-creation_date) > ?", nativeQuery=true) void deleteObsoleteRecords(int maxNumberOfDays)
-