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