https://github.com/nkonev/spring-data-jpa-json-example
A minimal modern example of persisting JSONB in Hibernate 6 without external libraries
https://github.com/nkonev/spring-data-jpa-json-example
hibernate jpa json jsonb postgres postgresql spring-data spring-data-jpa
Last synced: about 2 months ago
JSON representation
A minimal modern example of persisting JSONB in Hibernate 6 without external libraries
- Host: GitHub
- URL: https://github.com/nkonev/spring-data-jpa-json-example
- Owner: nkonev
- Created: 2024-06-23T21:03:36.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T21:17:57.000Z (about 2 years ago)
- Last Synced: 2025-05-23T23:37:39.075Z (about 1 year ago)
- Topics: hibernate, jpa, json, jsonb, postgres, postgresql, spring-data, spring-data-jpa
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
```bash
docker exec -it spring-data-jpa-json-example_postgresql_1 psql -U hibernate_json
curl -i -X POST --url 'http://localhost:8080/book' -H 'Content-Type: application/json' -d '{"title":"Java", "author": "Juergen", "jsonbContent": {"publisher": "Packt", "priceInCents": 9899}}'
curl -i -X POST --url 'http://localhost:8080/book' -H 'Content-Type: application/json' -d '{"title":"Kotlin", "author": "Roman", "jsonbContent": {"publisher": "Ast", "priceInCents": 7899}}'
curl -Ss --url 'http://localhost:8080/book/all' | jq
```
# Links
* https://dzone.com/articles/postgres-json-functions-with-hibernate-6
* https://thorben-janssen.com/java-records-embeddables-hibernate/