content: package com.bookstore;
  
  import com.bookstore.entity.Book;
  import com.bookstore.naturalid.NaturalRepositoryImpl;
  import com.bookstore.service.BookstoreService;
  
  import org.springframework.boot.ApplicationRunner;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.Bean;
  import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  
  @SpringBootApplication
  @EnableJpaRepositories(repositoryBaseClass = NaturalRepositoryImpl.class)
  public class MainApplication {
      private final BookstoreService bookstoreService;
  
      public MainApplication(BookstoreService bookstoreService) {
          this.bookstoreService = bookstoreService;
      }
  
      public static void main(String[] args) {
          SpringApplication.run(MainApplication.class, args);
      }
  
      @Bean
      public ApplicationRunner init() {
          return args -> {
              bookstoreService.persistTwoBooks();
  
              Book book = bookstoreService.fetchFirstBookByNaturalId();
              System.out.println(book);
          };
      }
  }