Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Component
- public class MysqlESSync {
- @Autowired
- private RecipeRepository recipeRepository;
- @Transactional
- public void run() throws Exception {
- logger.info("Sync started");
- int nrecords = 0;
- for (RecipeEntity recipeEntity : recipeRepository.findAll()) {
- nrecords++;
- //do sth. useful
- }
- logger.info("Sync ended with {} records", nrecords);
- }
- }
Add Comment
Please, Sign In to add comment