Interface ExchangeRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Exchange,,String> org.springframework.data.jpa.repository.JpaRepository<Exchange,,String> org.springframework.data.repository.PagingAndSortingRepository<Exchange,,String> org.springframework.data.repository.query.QueryByExampleExecutor<Exchange>,org.springframework.data.repository.Repository<Exchange,String>
@Repository
public interface ExchangeRepository
extends org.springframework.data.jpa.repository.JpaRepository<Exchange,String>
Repository for queries for Exchange.
-
Method Summary
Modifier and TypeMethodDescriptionfindByActivatedCode(String code) Select registers by user id.findByActivatedWalletIdAndCode(String walletId, String code) 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
-
findByActivatedWalletIdAndCode
@Query("SELECT ex FROM Exchange ex WHERE ex.walletId = :walletId AND ex.code = :code AND ex.used = true AND ex.activated = true") Optional<Exchange> findByActivatedWalletIdAndCode(@Param("walletId") String walletId, @Param("code") String code) Select registers by user id.- Parameters:
walletId- id wallet product.code- prepaid code with amount.- Returns:
- Activated exchange from database.
-
findByActivatedCode
@Query("SELECT ex FROM Exchange ex WHERE ex.code = :code AND ex.used = true AND ex.activated = true") Optional<Exchange> findByActivatedCode(@Param("code") String code) Select registers by user id.- Parameters:
code- prepaid code with amount.- Returns:
- Activated exchange from database.
-