Interface CardMovementRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<CardMovement,,String> org.springframework.data.jpa.repository.JpaRepository<CardMovement,,String> org.springframework.data.repository.PagingAndSortingRepository<CardMovement,,String> org.springframework.data.repository.query.QueryByExampleExecutor<CardMovement>,org.springframework.data.repository.Repository<CardMovement,String>
@Repository
public interface CardMovementRepository
extends org.springframework.data.jpa.repository.JpaRepository<CardMovement,String>
Repository for queries for Account Product.
-
Method Summary
Modifier and TypeMethodDescriptionfindAllByUserId(String userId) Select registers by name.findByUserId(String userId) Select registers by name.findByUserIdAndCardProduct(String userId, String cardProduct) Select registers by user id.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
-
findAllByUserId
@Query("SELECT cd FROM CardMovement cd WHERE cd.userId.id = :userId") Optional<List<CardMovement>> findAllByUserId(@Param("userId") String userId) Select registers by name.- Parameters:
userId- user identifier.- Returns:
- list of account products by user object from database
-
findByUserId
@Query("SELECT cd FROM CardMovement cd WHERE cd.userId.id = :userId") Optional<CardMovement> findByUserId(@Param("userId") String userId) Select registers by name.- Parameters:
userId- user identifier.- Returns:
- list of account products by user object from database
-
findByUserIdAndCardProduct
@Query("SELECT cd FROM CardMovement cd WHERE cd.userId.id = :userId AND cd.cardProduct.id = :cardProduct") Optional<List<CardMovement>> findByUserIdAndCardProduct(@Param("userId") String userId, @Param("cardProduct") String cardProduct) Select registers by user id.- Parameters:
userId- name for backoffice.cardProduct- associated product- Returns:
- new list product movement object from database
-