An open API service indexing awesome lists of open source software.

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

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.