Lab#SB02-1: JPA
Relationships
Spring Boot JPA Relationships
Spring-Boot
lab
Spring Boot
Welcome to the cifojava2022-3 wiki!
1 Spring Boot Projects
Name | Type | Description | Link |
---|---|---|---|
Library0 | Server | Basic Spring Boot Project | Link Repo |
Library1 | Server-Rest | API Rest Book CRUD with Postman/Swagger |
Link Repo |
Library2 | Server-Rest | API Rest Author-Book @OneToMany @ManyToOne CRUD with Swagger |
Link Repo |
Library3 | Server | Library-Book @ManyToMany @OneToOne CRUD |
Link Repo |
Library4 | Server-Rest | API Rest Library-Book-Author @ManyToMany @OneToMany CRUD with Swagger and Inherence |
Link Repo |
Library5 | Server-Web | ThymeLeaf Web Project |
Link Repo |
Library6 | Server-Web | API Rest Book CRUD with Postman/Swagger and Pageable |
Link Repo |
1.1 Basic Spring Boot project
- Preliminary works:
- Create project on Spring Init
- Images, step-by-step to create project
- Lombok to make entities simplier
- Java-Faker to create entities
- Be careful with devtools!!
You must go to settings and mark it, CTRL+ALT+S on Advanced Settings: Allow Auto-make
- Very simple project: no database,
@BookService
with anArrayList<Book> books
where books are stored @RestController
and@Controller
to publish JSON data and an HTML web with Thymeleaf
- version 1.0 : spring boot executions, api REST and web
- version 2.0 : just some little modifications to explain what
th:
is
1.2 API Rest Book CRUD
with Postman/Swagger
- Base project:
- POM
- API REST Read CRUD
- DataBase H2
- Application.properties
- Command Line Runner with methods to test
- Postman to test API REST, Postman web
- @Entity, @RestController, @Service, @CrudRepository JPA 2.0, @Component
- Repo Code GitHub
- Library1 Documentation
1.4 Library-Book @ManyToMany
and @OneToOne
CRUD
- Base project:
- Library2
- Two/Three entities related
@ManyToMany
, that is,n:m
and@OneToOne
1:1
- Library3 Documentation
- Repo GitHub Code
1.6 ThymeLeaf
Web Project
- Base project:
- Library
- Templates HTML Thymeleaf,
Templates Engine
- @Controller instead of @RestController
- Library5 Documentation
- Repo GitHub Code
1.7 Pagination
ThymeLeaf-Rest Web Project
- Base project:
- Library
- Templates HTML Thymeleaf,
Templates Engine
- @RestController
- Pagination and Sorting
- Library6 Documentation
- Repo GitHub Code