Spring Data Rest – How to create a RestAPIs with JPA One-to-Many relational entities | SpringBoot + MySql + HAL Browser
In the tutorial, I will show you how to build a Spring Data Rest One-To-Many relational entities with SpringBoot JPA.
Related posts:
- Spring Data Rest – How to create a RestAPIs with JPA Many-to-Many relational entities | SpringBoot + MySql + HAL Browser
- How to access MySQL database with Spring Data Rest application
- How to configure Spring JPA One to Many Relationship – SpringBoot
I. Technology
– Java 8
– Maven 3.6.1
– Spring Tool Suite: Version 3.8.4.RELEASE
– Spring Boot: 1.5.4.RELEASE
– MySQL
- Hal Browser
II. Practice
The tutorial creates a SpringBoot project with 2 Jpa entities {Company
,Product
} which have One-to-Many relationship. We use Spring Data Rest to build restfulAPIs for accessing MySQL data which are created by 2 entities. Then using HalBrowser to consume the rests.
Step to do:
- Create SpringBoot project
- Create Jpa entities
- Create Rest repositories
- Implement CommandLineRunner client
- Run and check results
1. Create SpringBoot project
Using SpringToolSuite to create a SpringBoot project. Then add dependencies:
More at:
Spring Data Rest – How to create a RestAPIs with JPA One-to-Many relational entities | SpringBoot + MySql + HAL Browser
Top comments (0)