-
Notifications
You must be signed in to change notification settings - Fork 6
Library2: API Rest Author Book @OneToMany CRUD with Swagger
Albert edited this page May 27, 2022
·
30 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
-
Author
@Entity -
1:n
relationship: unidrectional or bidirectional - Annotations:
- @OneToMany
- @ManyToMany
- @JoinColumn
-
JUnit Jupiter to test
-
ItellJIdea plug-in JUnit in action :
-
Maven Dependency: link junit-jupiter-api/5.9.0-M1
`<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->` `<dependency>` `<groupId>org.junit.jupiter</groupId>` `<artifactId>junit-jupiter-api</artifactId>` `<version>5.9.0-M1</version>` `<scope>test</scope>` `</dependency>`
-
-
version 1.0 : basic project:
- Author and Book @Entity wiht basic CRUD operations (Read and Create)
- without assigning
Author <1:n> Book
-
bug :=> just a typo dof instead of dob indob
parsing wrong to H2-DBconstructor
- BE CAREFUL :
-
version 1.1 : tests done by
JUnit
andSwagger
-
assign
Book > Autor
andAuthor > Book
-
study this problems :
-
@Jsonignore in @ManyToOne author attribute's book to avoid
Infinite Recursion
-
Execution
1:n
Bidirectional
-
-
version 1.2 : refactor and ddd (domains)
-
refactor to DDD,domains
-
responseEntity in action
-
all CRUD book methods impplemented
-
by Java Cifo 2022 IFCD53 Desenvolupament en Java amb framework Spring