aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/terminaldweller/doc/DocConfig.java
blob: 8b45535b69e0e50f9cf2924ebf5c25e308c1c41f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.terminaldweller.doc;

import java.util.List;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/** The config class. */
@Configuration
public class DocConfig {
  @Bean
  CommandLineRunner commandLineRunner(DocRepository repository) {
    return args -> {
      Doc mydoc1 = new Doc(11L, "mydoc1", 0L, "a one");
      Doc mydoc2 = new Doc(111L, "mydoc2", 0L, "and a two");

      repository.saveAll(List.of(mydoc1, mydoc2));
    };
  }
}