Interface CommentRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Comment,,Integer> org.springframework.data.jpa.repository.JpaRepository<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>
Repository interface to do queries for Comment data.
-
Method Summary
Modifier and TypeMethodDescriptionfindByIdAndUserId(String id, String userId) Finds a Comment by its identifier and user.findByProductIdAndTransferIdAndUserId(String productId, String transferId, String userId) Finds a Comment by product, movement and user IDs.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, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods 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
-
findByIdAndUserId
Finds a Comment by its identifier and user.- Parameters:
id- comment ID.userId- user identifier.- Returns:
- Comment
-
findByProductIdAndTransferIdAndUserId
Finds a Comment by product, movement and user IDs.- Parameters:
productId- product ID.transferId- transfer ID.userId- user ID.- Returns:
- Comment found by its movement ID
-