Class JSONBUserType

java.lang.Object
org.kiwiproject.hibernate.usertype.JSONBUserType
All Implemented Interfaces:
org.hibernate.usertype.UserType<String>

public class JSONBUserType extends Object implements org.hibernate.usertype.UserType<String>
A Hibernate user-defined type that maps to/from Postgres jsonb columns.
  • Constructor Details

    • JSONBUserType

      public JSONBUserType()
  • Method Details

    • getSqlType

      public int getSqlType()
      Specified by:
      getSqlType in interface org.hibernate.usertype.UserType<String>
    • returnedClass

      public Class<String> returnedClass()
      Specified by:
      returnedClass in interface org.hibernate.usertype.UserType<String>
    • equals

      public boolean equals(String ol, String o2) throws org.hibernate.HibernateException
      Specified by:
      equals in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
    • hashCode

      public int hashCode(String obj) throws org.hibernate.HibernateException
      Specified by:
      hashCode in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
    • nullSafeGet

      public String nullSafeGet(ResultSet rs, int position, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) throws org.hibernate.HibernateException, SQLException
      Specified by:
      nullSafeGet in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
      SQLException
    • nullSafeSet

      public void nullSafeSet(PreparedStatement st, String value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws org.hibernate.HibernateException, SQLException
      Specified by:
      nullSafeSet in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
      SQLException
    • deepCopy

      public String deepCopy(String value) throws org.hibernate.HibernateException
      Specified by:
      deepCopy in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
    • isMutable

      public boolean isMutable()
      Specified by:
      isMutable in interface org.hibernate.usertype.UserType<String>
    • disassemble

      public Serializable disassemble(String value) throws org.hibernate.HibernateException
      Specified by:
      disassemble in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
    • assemble

      public String assemble(Serializable cached, Object owner) throws org.hibernate.HibernateException
      Specified by:
      assemble in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException
    • replace

      public String replace(String original, String target, Object owner) throws org.hibernate.HibernateException
      Specified by:
      replace in interface org.hibernate.usertype.UserType<String>
      Throws:
      org.hibernate.HibernateException