{"id":24625139,"url":"https://github.com/ricall/jpa-validation","last_synced_at":"2026-04-18T13:36:00.529Z","repository":{"id":208728011,"uuid":"332182947","full_name":"ricall/jpa-validation","owner":"ricall","description":"Java application demoing JPA persistence, spring-mvc validation, and caching.","archived":false,"fork":false,"pushed_at":"2021-01-23T19:06:40.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-01-25T04:12:59.069Z","etag":null,"topics":["boot","caching","flyway","java","spring","validation"],"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/ricall.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}},"created_at":"2021-01-23T10:26:48.000Z","updated_at":"2021-01-23T19:08:32.000Z","dependencies_parsed_at":"2023-11-23T01:39:09.485Z","dependency_job_id":"bc0a5aea-60de-43ab-abec-23d40a5c4dbf","html_url":"https://github.com/ricall/jpa-validation","commit_stats":null,"previous_names":["ricall/jpa-validation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricall%2Fjpa-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricall%2Fjpa-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricall%2Fjpa-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricall%2Fjpa-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricall","download_url":"https://codeload.github.com/ricall/jpa-validation/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244385812,"owners_count":20444150,"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":["boot","caching","flyway","java","spring","validation"],"created_at":"2025-01-25T04:13:06.881Z","updated_at":"2026-04-18T13:36:00.519Z","avatar_url":"https://github.com/ricall.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jpa-validation\n\nSimple project that demonstrates Spring Boot JSON serialization/deserialization and validation using a simple entity model of `Product` and `ProductType` objects.\n\nFeatures:\n* Spring Boot\n* Simple JSON rest endpoints\n* Custom JSON serialization/deserialization\n* Caching\n* JPA + Spring Data Repositories\n* Flyway database migration\n* Mock MVC testing using jsonPath()\n* Jacoco code coverage (with custom exclusions)\n\nExample method with request validation.\n```java\n    @PostMapping(\"/product\")\n    public ResponseEntity\u003cProduct\u003e addProduct(@Valid @RequestBody Product product) {\n        return ResponseEntity.ok(service.save(product));\n    }\n```\n\n## How to use it\nThe code can be tested using:\n```bash\n$ ./gradlew clean check\n```\n\nTo start the application:\n```bash\n$ ./gradlew bootRun\n```\n\nThe application is available on http://localhost:8080 (You can view the application health on http://localhost:8080/actuator/health)\n\n### Add a product\nPOST http://localhost:8080/product\n```json\n{\n\t\"name\": \"Product1\",\n\t\"type\": \"X1\",\n\t\"category\": \"insurance\",\n\t\"subCategory\": \"life insurance\",\n\t\"roleStart\": \"2021-01-03T11:00:01\",\n\t\"roleEnd\": null\n}\n```\n\n### Add a product (that will fail validation)\nPOST http://localhost:8080/product\n```json\n{\n\t\"name\": null,\n\t\"type\": \"foo\",\n\t\"category\": null,\n\t\"subCategory\": null,\n\t\"roleStart\": null,\n\t\"roleEnd\": null\n}\n```\n\n### Get a product\nGET http://localhost:8080/product/{id}\n\n### Get product types\nGET http://localhost:8080/productTypes\n\n### Update a product\nPATCH http://localhost:8080/product/{id}\n```json\n{\n  \"name\": \"Product2\",\n  \"type\": \"R3\",\n  \"category\": \"insurance\",\n  \"subCategory\": \"life insurance\",\n  \"roleStart\": \"2021-02-03T11:00:01\",\n  \"roleEnd\": null\n}\n```\n\n### To flush the cache and force Spring to load entities from the DB\nPOST http://localhost:8080/cache\n```json\nRESET\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricall%2Fjpa-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricall%2Fjpa-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricall%2Fjpa-validation/lists"}