Guest User

Untitled

a guest
Jun 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. @Component
  2. public class MysqlESSync {
  3.  
  4. @Autowired
  5. private RecipeRepository recipeRepository;
  6.  
  7. @Transactional
  8. public void run() throws Exception {
  9. logger.info("Sync started");
  10. int nrecords = 0;
  11. for (RecipeEntity recipeEntity : recipeRepository.findAll()) {
  12. nrecords++;
  13.  
  14. //do sth. useful
  15. }
  16.  
  17. logger.info("Sync ended with {} records", nrecords);
  18. }
  19. }
Add Comment
Please, Sign In to add comment