Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

kissaten/hibernate-jsonb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hibernate-jsonb

Hibernate 4.3.x (JPA 2.1) + PostgreSQL 9.4 JSONB support example.

  • Hibernate dialect with JSONB support
  • Hibernate user-type for JSONB support (from a String)
  • Static-metamodel & SQL generation
  • Simple DAO with native JSONB query

Deploy to Heroku

Then test it by running:

$ curl -d "{ \"answer\": 42 }" https://<your-app-name>.herokuapp.com/

For an example that uses Jackson to map POJOs to JSONB see pires/hibernate-postgres-jsonb.

Build and test

PostgreSQL 9.4

Install, configure and start PostgreSQL 9.4 on localhost. If you change this, you must update src/test/resources/META-INF/persistence.xml accordingly.

sudo su postgres
createdb dbtest

Test

mvn clean test

Generate drop-create SQL

The sample app is configured to automatically update the database schema in "prod" mode and (re)create the schema in "test" mode. But you can also manually create the schema with Maven or the scripts in the sql/ directory.

mvn clean package -Pgenerate-sql

See sql/drop-create.sql

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages