Interface CommentRepository

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

@Repository public interface CommentRepository extends org.springframework.data.jpa.repository.JpaRepository<Comment,Integer>
Spring Data JPA repository for Comment entities.

Provides standard CRUD operations as well as custom query methods for retrieving comments associated with a specific activity.

Author:
SportTrack Team
  • Method Summary

    Modifier and Type
    Method
    Description
    Finds all comments attached to the specified activity, ordered by creation time descending.

    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

    • findByActivityIdOrderByCreatedAtDesc

      List<Comment> findByActivityIdOrderByCreatedAtDesc(int activityId)
      Finds all comments attached to the specified activity, ordered by creation time descending.
      Parameters:
      activityId - the unique identifier of the activity
      Returns:
      a list of comments for the activity, newest first