Interface FileArchiveRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<FileArchivatorBean,Long>, DomainIdRepository<FileArchivatorBean,Long>, org.springframework.data.jpa.repository.JpaRepository<FileArchivatorBean,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<FileArchivatorBean>, org.springframework.data.repository.PagingAndSortingRepository<FileArchivatorBean,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<FileArchivatorBean>, org.springframework.data.repository.Repository<FileArchivatorBean,Long>

@Repository public interface FileArchiveRepository extends DomainIdRepository<FileArchivatorBean,Long>
  • Method Details

    • findDistinctAllByProductLikeAndFilePathLikeAndDomainId

      List<FileArchivatorBean> findDistinctAllByProductLikeAndFilePathLikeAndDomainId(String product, String filePath, int domainId)
    • findDistinctAllByCategoryLikeAndFilePathLikeAndDomainId

      List<FileArchivatorBean> findDistinctAllByCategoryLikeAndFilePathLikeAndDomainId(String category, String filePath, int domainId)
    • findAllByReferenceIdAndUploadedAndDomainId

      org.springframework.data.domain.Page<FileArchivatorBean> findAllByReferenceIdAndUploadedAndDomainId(Long referenceId, int uploaded, int domainId, org.springframework.data.domain.Pageable pageable)
    • findAllByReferenceIdAndUploadedAndDomainId

      List<FileArchivatorBean> findAllByReferenceIdAndUploadedAndDomainId(Long referenceId, int uploaded, int domainId)
    • findAllByReferenceIdAndDomainId

      List<FileArchivatorBean> findAllByReferenceIdAndDomainId(Long referenceId, int domainId)
    • findFirstByReferenceIdOrderByOrderIdAsc

      FileArchivatorBean findFirstByReferenceIdOrderByOrderIdAsc(int orderId)
    • findDistinctReferenceIds

      @Query("SELECT DISTINCT fab.referenceId FROM FileArchivatorBean fab WHERE fab.uploaded = 0 AND fab.referenceId > 0 AND fab.domainId = :domainId") List<Integer> findDistinctReferenceIds(@Param("domainId") Integer domainId)
    • getDistinctCategory

      @Query("SELECT DISTINCT fab.category FROM FileArchivatorBean fab WHERE fab.domainId = :domainId") List<String> getDistinctCategory(@Param("domainId") Integer domainId)
    • getDistinctProduct

      @Query("SELECT DISTINCT fab.product FROM FileArchivatorBean fab WHERE fab.domainId = :domainId") List<String> getDistinctProduct(@Param("domainId") Integer domainId)
    • updateCategory

      @Transactional @Modifying @Query("UPDATE FileArchivatorBean fab SET fab.category = :newCategory WHERE fab.category = :oldCategory AND fab.domainId = :domainId") void updateCategory(@Param("oldCategory") String oldCategory, @Param("newCategory") String newCategory, @Param("domainId") Integer domainId)
    • updateProduct

      @Transactional @Modifying @Query("UPDATE FileArchivatorBean fab SET fab.product = :newProduct WHERE fab.product = :oldProduct AND fab.domainId = :domainId") void updateProduct(@Param("oldProduct") String oldProduct, @Param("newProduct") String newProduct, @Param("domainId") Integer domainId)
    • findAllMainFilesUploadedNotPatternsVirtualPathLike

      @Query("SELECT fab FROM FileArchivatorBean fab WHERE CONCAT(fab.filePath, fab.fileName) LIKE :pattern AND fab.domainId = :domainId AND fab.referenceId = -1 AND fab.uploaded = -1 GROUP BY CONCAT(fab.filePath, fab.fileName)") List<FileArchivatorBean> findAllMainFilesUploadedNotPatternsVirtualPathLike(@Param("pattern") String pattern, @Param("domainId") Integer domainId)
    • findAllByReferenceToMainAndDomainId

      List<FileArchivatorBean> findAllByReferenceToMainAndDomainId(String referenceToMain, Integer domainId)
    • findAllByReferenceToMainAndReferenceIdAndDomainId

      List<FileArchivatorBean> findAllByReferenceToMainAndReferenceIdAndDomainId(String referenceToMain, Integer referenceId, Integer domainId)
    • findAllByUploadedAndDomainId

      List<FileArchivatorBean> findAllByUploadedAndDomainId(Integer uploaded, Integer domainId)
    • updateReferenceToMain

      @Transactional @Modifying @Query("UPDATE FileArchivatorBean fab SET fab.referenceToMain = :newReferenceToMain WHERE fab.referenceToMain = :oldReferenceToMain AND fab.domainId = :domainId") void updateReferenceToMain(@Param("oldReferenceToMain") String oldReferenceToMain, @Param("newReferenceToMain") String newReferenceToMain, @Param("domainId") Integer domainId)
    • updateReferenceToMain

      @Transactional @Modifying @Query("UPDATE FileArchivatorBean fab SET fab.referenceToMain = :referenceToMain WHERE fab.referenceId = :referenceId AND fab.domainId = :domainId") void updateReferenceToMain(@Param("referenceId") Long referenceId, @Param("referenceToMain") String referenceToMain, @Param("domainId") Integer domainId)
    • getReferenceToMain

      @Query("SELECT fab.referenceToMain FROM FileArchivatorBean fab WHERE fab.id = :id AND fab.domainId = :domainId") String getReferenceToMain(@Param("id") Long id, @Param("domainId") Integer domainId)
    • countReferencesToMain

      @Query("SELECT COUNT(fab.id) FROM FileArchivatorBean fab WHERE fab.referenceToMain = :referenceToMain AND fab.domainId = :domainId") Integer countReferencesToMain(@Param("referenceToMain") String referenceToMain, @Param("domainId") Integer domainId)
    • findAllByIdInAndReferenceIdAndReferenceToMainAndDomainId

      org.springframework.data.domain.Page<FileArchivatorBean> findAllByIdInAndReferenceIdAndReferenceToMainAndDomainId(Integer[] ids, Integer referenceId, String referenceToMain, Integer domainId, org.springframework.data.domain.Pageable pageable)
    • findAllMainFilesUploadedNotPatternIdsIn

      @Query("SELECT fab FROM FileArchivatorBean fab WHERE fab.globalId IN :globalIds AND fab.referenceId = -1 AND fab.uploaded = -1 AND (fab.referenceToMain IS NULL OR fab.referenceToMain = \'\') AND fab.domainId = :domainId") List<FileArchivatorBean> findAllMainFilesUploadedNotPatternIdsIn(@Param("globalIds") List<Integer> globalIds, @Param("domainId") Integer domainId, org.springframework.data.domain.Pageable pageable)
    • findIdByFilePathAndFileName

      @Query("SELECT fab.id FROM FileArchivatorBean fab WHERE fab.filePath = :filePath AND fab.fileName = :fileName AND fab.domainId = :domainId") Optional<Long> findIdByFilePathAndFileName(@Param("filePath") String filePath, @Param("fileName") String fileName, @Param("domainId") Integer domainId)