Library2: API Rest Author Book @OneToMany CRUD with Swagger - AlbertProfe/cifojava2022-3 GitHub Wiki
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:nrelationship: 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 indobparsing wrong to H2-DBconstructor - BE CAREFUL :
-
version 1.1 : tests done by
JUnitandSwagger-
assign
Book > AutorandAuthor > Book -
study this problems :
-
@Jsonignore in @ManyToOne author attribute's book to avoid
Infinite Recursion -
Execution
1:nBidirectional
-
-
version 1.2 : refactor and ddd (domains)
-
refactor to DDD,domains
-
responseEntity in action
-
all CRUD book methods impplemented
-