Interface DocForumRepository

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

@Repository public interface DocForumRepository extends DomainIdRepository<DocForumEntity,Long>
  • Method Details

    • updateSubtopic

      @Transactional @Modifying @Query(value="UPDATE document_forum SET stat_replies = stat_replies+1, stat_last_post = ?1 WHERE forum_id = ?2 AND parent_id = -1 AND domain_id = ?3", nativeQuery=true) void updateSubtopic(Date statLastPost, Long forumId, Integer domainId)
    • findByIdAndDomainIdOrderByQuestionDateAsc

      Optional<DocForumEntity> findByIdAndDomainIdOrderByQuestionDateAsc(Long id, Integer domainId)
    • findByIdAndDomainIdOrderByQuestionDateDesc

      Optional<DocForumEntity> findByIdAndDomainIdOrderByQuestionDateDesc(Long id, Integer domainId)
    • findById

      Optional<DocForumEntity> findById(Long forumId)
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<DocForumEntity,Long>
    • getDocForumListForumIdParentId

      @Query("SELECT new sk.iway.iwcm.components.forum.jpa.DocForumIdAndParentId(fe.id, fe.parentId) FROM DocForumEntity fe WHERE fe.docId = :docId AND fe.parentId > 0 AND fe.deleted = :deleted AND fe.confirmed = :confirmed AND fe.domainId = :domainId ORDER BY fe.id ASC") List<DocForumIdAndParentId> getDocForumListForumIdParentId(@Param("docId") Integer docId, @Param("deleted") Boolean deleted, @Param("confirmed") Boolean confirmed, @Param("domainId") Integer domainId)
    • getDocForumListForumIdParentIdWithRootParents

      @Query("SELECT new sk.iway.iwcm.components.forum.jpa.DocForumIdAndParentId(fe.id, fe.parentId) FROM DocForumEntity fe WHERE fe.docId = :docId AND fe.deleted = :deleted AND fe.confirmed = :confirmed AND fe.domainId = :domainId ORDER BY fe.id ASC") List<DocForumIdAndParentId> getDocForumListForumIdParentIdWithRootParents(@Param("docId") Integer docId, @Param("deleted") Boolean deleted, @Param("confirmed") Boolean confirmed, @Param("domainId") Integer domainId)
    • getDocForumListAsc

      @Query("SELECT fe FROM DocForumEntity fe WHERE fe.docId = :docId AND fe.parentId IN :parentIds AND fe.deleted = :deleted AND fe.confirmed = :confirmed AND fe.domainId = :domainId ORDER BY fe.questionDate ASC") List<DocForumEntity> getDocForumListAsc(@Param("docId") Integer docId, @Param("parentIds") List<Integer> parentIds, @Param("deleted") Boolean deleted, @Param("confirmed") Boolean confirmed, @Param("domainId") Integer domainId)
    • getDocForumListDesc

      @Query("SELECT fe FROM DocForumEntity fe WHERE fe.docId = :docId AND fe.parentId IN :parentIds AND fe.deleted = :deleted AND fe.confirmed = :confirmed AND fe.domainId = :domainId ORDER BY fe.questionDate DESC") List<DocForumEntity> getDocForumListDesc(@Param("docId") Integer docId, @Param("parentIds") List<Integer> parentIds, @Param("deleted") Boolean deleted, @Param("confirmed") Boolean confirmed, @Param("domainId") Integer domainId)
    • getForumStat

      @Query("SELECT fe FROM DocForumEntity fe WHERE fe.docId = :docId AND fe.parentId = -1 AND fe.deleted = :deleted AND fe.domainId = :domainId ORDER BY fe.statLastPost DESC") List<DocForumEntity> getForumStat(@Param("docId") Integer docId, @Param("deleted") Boolean deleted, @Param("domainId") Integer domainId)
    • findFirstByDocIdAndDomainIdOrderByQuestionDateDesc

      Optional<DocForumEntity> findFirstByDocIdAndDomainIdOrderByQuestionDateDesc(Integer docId, Integer domainId)