Sprężyna metoda wywołania rozruchu po uruchomieniu z repozytorium

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class Initializer implements CommandLineRunner {

    private final YourRepository yourRepository;

    public Initializer(YourRepository yourRepository) {
        this.yourRepository = yourRepository;
    }

    @Override
    public void run(String... args) throws Exception {
      // your logic, for example:
      yourRepository.findAll();
    }
}
Zwazel