https://github.com/ashutoshsahoo/spring-data-jpa-mapping
Spring Data JPA Mapping
https://github.com/ashutoshsahoo/spring-data-jpa-mapping
h2 h2-database hibernate java java-date-time-api lombok manytoone maven onetomany onetoone spring spring-boot spring-data-jpa springframework
Last synced: about 2 months ago
JSON representation
Spring Data JPA Mapping
- Host: GitHub
- URL: https://github.com/ashutoshsahoo/spring-data-jpa-mapping
- Owner: ashutoshsahoo
- Created: 2018-09-04T21:05:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2026-03-13T19:50:40.000Z (3 months ago)
- Last Synced: 2026-03-14T07:53:18.877Z (3 months ago)
- Topics: h2, h2-database, hibernate, java, java-date-time-api, lombok, manytoone, maven, onetomany, onetoone, spring, spring-boot, spring-data-jpa, springframework
- Language: Java
- Homepage:
- Size: 82 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Data JPA Mapping
## Start Application
* To `mapstruct` to work properly, use following commands to run the application.
```shell
gradle clean build
gradle clean bootRun
```
* Open [swagger-ui](http://localhost:8080/swagger-ui/index.html) test the application.
## ManyToOne
* User Table
| ID | NAME |
|------|------|
| 1001 | Ashu |
* Post Table
| ID | MESSAGE | POST_CREATE_TIME | POST_LAST_UPDATE_TIME | USER_ID |
|----------------------------------|---------|----------------------------|----------------------------|---------|
| 48ba9b1c22ec4030b064f8d226cfdac1 | Hi Ashu | 2022-05-08 12:59:57.844103 | 2022-05-08 12:59:57.844103 | 1001 |
## OneToOne
* Employee Table
| ID | NAME |
|------|------|
| 1001 | Ashu |
* Locker Table
| LOCKER_NO | EMPLOYEE_ID |
|-----------|-------------|
| LOCK101 | 1001 |
## Test
Run [Postman Collection](./spring-data-jpa-mapping.postman_collection.json) to test the application. Check the test
results for any errors.