{"id":21030505,"url":"https://github.com/albertprofe/cifojava2021-javase-4","last_synced_at":"2025-10-19T13:22:38.933Z","repository":{"id":106355639,"uuid":"380938463","full_name":"AlbertProfe/cifojava2021-javase-4","owner":"AlbertProfe","description":"JPA and Rest Controller (Swagger) with Spring Boot. JPA @OnToMany, @ManyToOne @ManyToMany (just JPA). ","archived":false,"fork":false,"pushed_at":"2021-07-12T10:00:55.000Z","size":171,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T15:19:01.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlbertProfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-28T07:07:11.000Z","updated_at":"2021-07-12T10:00:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"e40b23de-7f98-4c16-83fb-fd9150c83fbe","html_url":"https://github.com/AlbertProfe/cifojava2021-javase-4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertProfe%2Fcifojava2021-javase-4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertProfe%2Fcifojava2021-javase-4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertProfe%2Fcifojava2021-javase-4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlbertProfe%2Fcifojava2021-javase-4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlbertProfe","download_url":"https://codeload.github.com/AlbertProfe/cifojava2021-javase-4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243466990,"owners_count":20295310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T12:18:43.751Z","updated_at":"2025-10-19T13:22:38.824Z","avatar_url":"https://github.com/AlbertProfe.png","language":"Java","readme":"# cifojava2021-javase-4 \nJPA and Rest Controller (Swagger) with Spring Boot. JPA @OnToMany, @ManyToOne @ManyToMany (just JPA). \n\nWelcome to the cifojava2021-javase-4 and javaeewiki!\n\n# cifojava2021-javase-4 and javaee\nJPA @OneToMany, @ManyToOne, @ManyToMany and @JoinColumn, @JoinTable\n- Spring Boot JPA **without** @Controller, View and Thymeleaf\n- So we use **CommandLineRunner** to test JPA _entities_.\n- Applications.properties\n- Classes: JPA @Entity Employee and CrudRepository Interface\n- Database: H2 (local or in Memory) and ddl.auto\n\nJPA **and REST API** @OneToMany, @ManyToOne, @ManyToMany and @JoinColumn, @JoinTable and @RestController\n- Rest Controller (Postman and Swagger)\n\n\n## amazonDeliver (java-EE spring)\n\n- amazonDeliver : `n:m` with `1:n` `n:1`\n   - @Entity as TA (_OrderService_)\n   - with _CommandLineRunner_ \n   - **Employee \u003c\u003e OrderService \u003c\u003e Shop**\n- amazonDeliver2 : `n:m` with `1:n` `n:1`\n   -  add another @Entity to OrderService (_Vehicle_)\n   - with _CommandLineRunner_ \n   - Employee \u003c\u003e OrderService \u003c\u003e Shop \n   - **OrderService \u003c\u003e Vehicle**\n- amazonDeliver3 : `n:m`\n   - without @Entity as TA (_Product_)\n   - with _CommandLineRunner_ \n   - Employee \u003c\u003e OrderService \u003c\u003e **Shop \u003c\u003e Product**\n   - OrderService \u003c\u003e Vehicle\n- amazonDeliver4 : `n:m` \n   - web Project (we don't need **CommandLineRunner** because it is a web project now wiht @RestController **but** we leave it to fill the db)\n   - Employee \u003c\u003e OrderService \u003c\u003e Shop \u003c\u003e Product\n   - OrderService \u003c\u003e Vehicle\n   - @RestController\n      - @EmployeeRestController with all CRUD operations\n      - Postman\n      - @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = \"id\") at _entities_\n- amazonDeliver5 : `n:m` \n   - web Project (we don't need **CommandLineRunner** because it is a web project now wiht @RestController **but** we leave it to fill the db)\n   - Employee \u003c\u003e OrderService \u003c\u003e Shop \u003c\u003e Product\n   - OrderService \u003c\u003e Vehicle\n   - @RestController\n      - @EmployeeRestController with all CRUD operations\n      - **Swagger**\n           - class: SpringFoxConfig\n           - Dependency\n           - Main @Bean\n           - Open URL: http://localhost:8086/swagger-ui.htm\n      - @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = \"id\") at _entities_ \n\n\n\n\u003ca href=\"https://github.com/AlbertProfe/images/blob/main/cifospring2021/amazon.png\"\u003e\u003cimg src=\"https://github.com/AlbertProfe/images/blob/main/cifospring2021/amazon.png\" width=\"600\"\u003e\u003c/a\u003e\n\n## employeeExpenses (java-EE spring)\n\n- employeeExpenses: `1:m` unidirectional \n   - Employee \u003c\u003e Expense\n- employeeExpenses2: `n:m` bidirectional\n   - Employee \u003c\u003e Expense\n   - Employee \u003c\u003e Holidays\n- employeeExpenses3: `n:m` TA without @Entity\n   - Employee \u003c\u003e Expense\n   - Employee \u003c\u003e Holidays\n   - Employee \u003c\u003e Course\n- employeeExpenses4: `n:m` TA as @Entity and `1:n` `n:1`\n   - Employee \u003c\u003e Expense\n   - Employee \u003c\u003e Holidays\n   - Employee \u003c\u003e EnrollmentCourse \u003c\u003e Certificate\n- employeeExpenses5: `n:m` TA as two @Entity and `1:n` `n:1` `1:n`\n   - Employee \u003c\u003e Expense\n   - Employee \u003c\u003e Holidays\n   - Employee \u003c\u003e Enrollment \u003c\u003e Course \u003c\u003e Certificate\n\n\n\u003ca href=\"https://github.com/AlbertProfe/images/blob/main/cifospring2021/employeeExpenses5.png\"\u003e\u003cimg src=\"https://github.com/AlbertProfe/images/blob/main/cifospring2021/employeeExpenses5.png\" width=\"600\"\u003e\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertprofe%2Fcifojava2021-javase-4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertprofe%2Fcifojava2021-javase-4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertprofe%2Fcifojava2021-javase-4/lists"}