Package com.nadiyar.kiwi.repository
Interface MessageRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Message,,Long> org.springframework.data.jpa.repository.JpaRepository<Message,,Long> org.springframework.data.repository.ListCrudRepository<Message,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<Message,,Long> org.springframework.data.repository.PagingAndSortingRepository<Message,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<Message>,org.springframework.data.repository.Repository<Message,Long>
public interface MessageRepository
extends org.springframework.data.jpa.repository.JpaRepository<Message,Long>
Repository interface for accessing and managing
Message entities.
This interface extends JpaRepository, providing standard CRUD
operations,
pagination, and query method execution for Message entities.
In addition to the inherited methods, it declares a custom finder:
findAllByOrderBySentAtAsc()— Retrieves all messages sorted in ascending order by theirsentAttimestamp.
The query method name follows the Spring Data JPA naming conventions and will be automatically implemented by Spring at runtime.
- Author:
- Nadiyar
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves allMessageentities ordered by theirsentAttimestamp in ascending order.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
-
findAllByOrderBySentAtAsc
Retrieves allMessageentities ordered by theirsentAttimestamp in ascending order.This method uses Spring Data JPA's derived query mechanism and does not require a custom JPQL query.
- Returns:
- a list of messages sorted from the earliest to the latest by
sentAt.
-