Lab#SB02-1: JPA Relationships

Spring Boot JPA Relationships

Spring-Boot
lab
Spring Boot
Author

albertprofe

Published

Tuesday, June 1, 2021

Modified

Friday, November 1, 2024

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 an ArrayList<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

Projects Table

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

Projects Table

1.3 API Rest Author-Book @OneToMany CRUD with Swagger

Projects Table

1.4 Library-Book @ManyToMany and @OneToOne CRUD

Projects Table

1.5 API Rest Library-Book-Author @ManyToMany @OneToMany CRUD with Swagger and Inherence

Projects Table

1.6 ThymeLeaf Web Project

Projects Table

1.7 Pagination ThymeLeaf-Rest Web Project

Projects Table

Back to top