Tutorial by Examples

This example is based on spring boot 1.5.1.RELEASE. with the following dependencies: <!-- Spring --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency>...
First, lets overview what we need in order to setup Hibernate correctly. @EnableTransactionManagement and @EnableJpaRepositories - we want transactional management and to use spring data repositories. DataSource - main datasource for the application. using in-memory h2 for this example. LocalCo...
A simple entity: Using Lombok @Getter and @Setter annotations to generate getters and setters for us @Entity @Getter @Setter public class Message { @Id @GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid...
In order to expose Thymeleaf templates we need to define controllers. Example: @Controller @RequestMapping("/") public class MessageController { @Autowired private MessageRepository messageRepository; @GetMapping public ModelAndView index() { It...

Page 1 of 1