Skip to content

Instantly share code, notes, and snippets.

View madz0's full-sized avatar

Madz madz0

  • Amsterdam, Netherlands
View GitHub Profile

Keybase proof

I hereby claim:

  • I am madz0 on github.
  • I am madz0 (https://keybase.io/madz0) on keybase.
  • I have a public key ASAxCXh_FquNJakohCrsSRqnqc2LrkLlO8sD8S5ZFkIkdAo

To claim this, I am signing this object:

@madz0
madz0 / h2-jsonb.md
Created October 9, 2019 18:21
jsonb work around for H2 database

Creat a package-info file in the models package and put the following contents in there:

@org.hibernate.annotations.TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
package com.ourproject.model;

import com.vladmihalcea.hibernate.type.json.JsonBinaryType;

I used JsonBinaryType in hibernate-types-52 library.

Then in the entity class, I removed columnDefinition="jsonb" from the @Column and only used @Type(type = "jsonb")