spring-guides / tut-spring-boot-kotlin

Building web applications with Spring Boot and Kotlin :: Learn how to easily build and test web applications with Spring, Kotlin, Junit 5 and JPA

Home Page:https://spring.io/guides/tutorials/spring-boot-kotlin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The document must be modified.

puresprout opened this issue · comments

https://spring.io/guides/tutorials/spring-boot-kotlin/

In part 'Then, we add data initialization to a new BlogConfiguration class.'
of the above site, the code should be as follows.

        val johnDoe = userRepository.save(User("johnDoe", "John", "Doe"))
        articleRepository.save(Article(
            title = "Lorem",
            headline = "Lorem",
            content = "dolor sit amet",
            author = johnDoe
        ))
        articleRepository.save(Article(
            title = "Ipsum",
            headline = "Ipsum",
            content = "dolor sit amet",
            author = johnDoe
        ))

The code for github is correct.