| Start |
|---|
| Hibernate Configuration First, lets overview what we need in order to setup Hibernate correctly.
Configuration file: |
| Entities and Repositories A simple entity: Using Lombok I am using UUID based ids and lombok to generate getters and setters. A simple repository for the entity above: More on respositories: spring data docs (opens new window) Make sure entities reside in a package that is mapped in |
| Maven dependencies This example is based on spring boot 1.5.1.RELEASE. with the following dependencies: In this example we are going to use Spring Boot JPA, Thymeleaf and web starters. I am using Lombok to generate getters and setters easier but it is not mandatory. H2 will be used as an in-memory easy to configure database. |
| Thymeleaf Resources and Spring Controller In order to expose Thymeleaf templates we need to define controllers. Example: This simple controller injects In the same way, we can place other templates in the templates folder (default by spring to Other static resources should be placed in one of the following folders, exposed by default in spring boot: Thymeleaf
RemarksAlso check the Thymeleaf documentation (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference