Creating a project

To create a project, go to  https://start.spring.io and create a Kotlin-based project. Here are the dependencies of the project:

  • Web
  • JDBC
  • MySQL
  • DevTools
  • JPA
  • H2

You can find these in the pom.xml file. There you can update, add, or remove the dependencies.

To enable JPA auditing, you need to annotate @EnableJpaAuditing annotation on the SocialNetworkApplication.kt class. It will enable the use of JPA functionalities.

Here is the code for this class:

@SpringBootApplication
@EnableJpaAuditing
class SocialNetworkApplication

fun main(args: Array<String>) {
runApplication<SocialNetworkApplication>(*args)
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.172.115