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 TypeMethodDescriptionfindByActivityIdOrderByCreatedAtDesc(int activityId) 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, 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.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
-
findByActivityIdOrderByCreatedAtDesc
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
-