-
Notifications
You must be signed in to change notification settings - Fork 6
Library3: API Rest Library Book @ManyToMany @OneToOne CRUD with Swagger
Albert edited this page May 30, 2022
·
19 revisions
Welcome to the cifojava2022-3 wiki!
- Base project:
- POM
- API REST Book
- DataBase H2:
Library2
-
First-time CREATE DDL : First-time CREATE DDL option (after that
UPDATE
) inapplication.properties
-
First-time CREATE DDL : First-time CREATE DDL option (after that
- Application.properties
- Command Line Runner with methods to test
- Swagger: URL swagger : http://localhost:8080/swagger-ui.html
- @Entity, @RestController, @Service, @CrudRepository JPA 2.0, @Component
-
Library
andAddress
@Entity -
1:1
relationship -
n:m
relationship:inverse-side
orowning-side
- Every @ManyToMany association has two sides and a join table:
- the owning side
- and the non-owning, or inverse, side.
- The join table for the relationship, if not defaulted,
- The join table is must be specified on the owning side.
- If the association is bidirectional, either side may be designated as the owning side.
- If the relationship is (not) bidirectional, the non-owning side must use the mappedBy element of the @ManyToMany annotation to specify the relationship field or property of the owning side.
- Every @ManyToMany association has two sides and a join table:
- Annotations:
- @OneToOne
- @ManyToMany
- @JoinTable
by Java Cifo 2022 IFCD53 Desenvolupament en Java amb framework Spring