Package sk.iway.iwcm.doc
Interface DocHistoryRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<DocHistory,,Long> org.springframework.data.jpa.repository.JpaRepository<DocHistory,,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<DocHistory>,org.springframework.data.repository.ListCrudRepository<DocHistory,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<DocHistory,,Long> org.springframework.data.repository.PagingAndSortingRepository<DocHistory,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<DocHistory>,org.springframework.data.repository.Repository<DocHistory,Long>
@Repository
public interface DocHistoryRepository
extends org.springframework.data.jpa.repository.JpaRepository<DocHistory,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<DocHistory>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object> -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByIdPublicable(Long historyId, boolean publicable) voiddeleteHistoryOnPublish(List<Integer> historyIds, int authorId) findByDocIdAndPublishStartDateBetween(Integer docId, Date publishStartDateFrom, Date publishStartDateTo) findByDocIdInActual(List<Integer> docIds) findGroupIdById(Long id) findMaxHistoryId(int docId) findMaxHistoryId(int docId, boolean actual) findOldHistoryIds(int docId, int historyId) findOldHistoryIds(int docId, Long historyId, boolean publicable, int authorId) getHisotryIdsByDocIdIn(Integer docIds) getPublicableByDocIdIn(Integer docIds) voidrejectDocHistory(String awaitingApprove, Integer disapprovedBy, Integer historyId) voidupdateActual(boolean actual, int[] historyIds) voidupdateActual(boolean actual, List<Integer> historyIds) voidupdateActualHistory(boolean actual, String awaitingApprove, List<Integer> historyIds) voidupdateAwaitingApprove(String awaitingApprove, Integer docId) voidupdatePublicableAndActual(boolean publicable, boolean actual, int approvedBy, boolean available, int historyId) 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, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, updateMethods 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
-
findByDocIdAndPublishStartDateBetween
List<DocHistory> findByDocIdAndPublishStartDateBetween(Integer docId, Date publishStartDateFrom, Date publishStartDateTo) -
findOldHistoryIds
-
deleteHistoryOnPublish
-
deleteByIdPublicable
@Transactional @Modifying @Query("DELETE FROM DocHistory WHERE id = :historyIds AND publicable = :publicable") void deleteByIdPublicable(@Param("historyIds") Long historyId, @Param("publicable") boolean publicable) -
findOldHistoryIds
-
updateActualHistory
-
updateActual
-
rejectDocHistory
@Transactional @Modifying @Query("UPDATE DocHistory SET awaitingApprove = :awaitingApprove, disapprovedBy = :disapprovedBy, syncStatus = 1 WHERE id = :historyId") void rejectDocHistory(@Param("awaitingApprove") String awaitingApprove, @Param("disapprovedBy") Integer disapprovedBy, @Param("historyId") Integer historyId) -
updateAwaitingApprove
-
findMaxHistoryId
-
findMaxHistoryId
@Query(value="SELECT max(history_id) AS max FROM documents_history WHERE doc_id=?", nativeQuery=true) Integer findMaxHistoryId(int docId) -
findGroupIdById
-
findByDocIdInActual
@Query("SELECT dh FROM DocHistory dh WHERE dh.docId IN :docIds AND dh.actual = 1") List<DocHistory> findByDocIdInActual(@Param("docIds") List<Integer> docIds) -
findTopByDocIdOrderBySaveDateDesc
-
updateActual
@Transactional @Modifying @Query("UPDATE DocHistory dh SET dh.actual = :actual WHERE dh.id IN :historyIds") void updateActual(@Param("actual") boolean actual, @Param("historyIds") int[] historyIds) -
updatePublicableAndActual
@Transactional @Modifying @Query("UPDATE DocHistory dh SET dh.publicable = :publicable, dh.actual = :actual, dh.approvedBy = :approvedBy, dh.syncStatus = 1, dh.available = :available WHERE dh.id = :historyId") void updatePublicableAndActual(@Param("publicable") boolean publicable, @Param("actual") boolean actual, @Param("approvedBy") int approvedBy, @Param("available") boolean available, @Param("historyId") int historyId) -
getPublicableByDocIdIn
-
getHisotryIdsByDocIdIn
-
getPublicableThatAreNotAwaitingToApprove
@Query("SELECT dh FROM DocHistory dh WHERE dh.publicable = true AND ( dh.awaitingApprove IS NULL OR dh.awaitingApprove = \'\' ) AND dh.publishStartDate IS NOT NULL") Optional<List<DocHistory>> getPublicableThatAreNotAwaitingToApprove()
-