Interface ApprovedPostRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ApprovedPost,Long>, org.springframework.data.jpa.repository.JpaRepository<ApprovedPost,Long>, org.springframework.data.repository.ListCrudRepository<ApprovedPost,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<ApprovedPost,Long>, org.springframework.data.repository.PagingAndSortingRepository<ApprovedPost,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<ApprovedPost>, org.springframework.data.repository.Repository<ApprovedPost,Long>

@Repository public interface ApprovedPostRepository extends org.springframework.data.jpa.repository.JpaRepository<ApprovedPost,Long>
Repository interface for managing ApprovedPost entities. Provides methods to find and delete approved posts based on message IDs.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deletes all approved posts that contain any of the specified message IDs.
    Finds the first approved post that contains any of the specified message IDs.
    Finds the first approved post ordered by the approval timestamp.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findFirstByOrderByApprovedAt

      Optional<ApprovedPost> findFirstByOrderByApprovedAt()
      Finds the first approved post ordered by the approval timestamp.
      Returns:
      an Optional containing the first approved post, or empty if none found
    • findFirstByMessageIdsIn

      Optional<ApprovedPost> findFirstByMessageIdsIn(List<Integer> messageIds)
      Finds the first approved post that contains any of the specified message IDs.
      Parameters:
      messageIds - a list of message IDs to search for
      Returns:
      an Optional containing the first approved post with matching message IDs, or empty if none found
    • deleteByMessageIdsIn

      List<ApprovedPost> deleteByMessageIdsIn(List<Integer> messageIds)
      Deletes all approved posts that contain any of the specified message IDs.
      Parameters:
      messageIds - a list of message IDs to search for
      Returns:
      a list of ApprovedPost entities that were deleted