Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. @Async
  2. @Cacheable(value="distributors")
  3. public CompletableFuture<Iterable<Distributors>> getAllDistributorsAsyncCaching() throws ExecutionException, InterruptedException {
  4.  
  5. Iterable<Distributors> result = distributorsRepository.findAll();
  6. return CompletableFuture.completedFuture(result);
  7.  
  8.  
  9.  
  10. }
  11.  
  12. @Async
  13. @Cacheable(value="distributors")
  14. public Iterable<Distributors> getAllDistributorsAsyncCaching() throws ExecutionException, InterruptedException {
  15.  
  16. Iterable<Distributors> result = distributorsRepository.findAll();
  17. return CompletableFuture.completedFuture(result);
  18.  
  19.  
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement