Async
Making Repository methods asynchronous.
@Collection("customer_repository")
public interface CustomerRepository extends Repository<Customer, UUID>, AsyncRepository<Customer, UUID> {
// Customer findFirstByFirstName(String firstName);
@Async
CompletableFuture<Customer> findFirstByFirstName(String firstName);
// List<Customer> findManyByCustomerIdIn(List<Integer> customerIdList);
@Async
CompletableFuture<List<Customer>> findManyByCustomerIdIn(List<Integer> customerIdList);
List<Customer> findManyByCustomerIdNotIn(List<Integer> customerIdList);
// List<Customer> findManyByCustomerIdExists();
@SortBy(field = "customerId")
@SortBy(field = "balance", ascending = true)
@Limit(10)
@Skip(5)
@Async
CompletableFuture<List<Customer>> findManyByCustomerIdExists();
List<Customer> findManyByCustomerIdNot(int customerId, Sort sort);
// boolean myTransformedMethod(String street);
@Transform("existsByStreet")
@Async
CompletableFuture<Boolean> myTransformedMethod(String street);
// boolean updateFieldsByFirstName(String firstName, UpdateBatch updateBatch);
@Async
CompletableFuture<Boolean> updateFieldsByFirstName(String firstName, UpdateBatch updateBatch);
}
Last updated