Class PostgreSQLHStoreType

java.lang.Object
io.hypersistence.utils.hibernate.type.ImmutableType<Map>
io.hypersistence.utils.hibernate.type.basic.PostgreSQLHStoreType
All Implemented Interfaces:
Serializable, org.hibernate.type.Type, org.hibernate.usertype.UserType<Map>

public class PostgreSQLHStoreType extends ImmutableType<Map>
Maps a Map object type to a PostgreSQL hstore column type.

For more details about how to use it, check out this article on vladmihalcea.com.

Author:
Edgar Asatryan, Vlad Mihalcea
See Also:
  • Field Details

  • Constructor Details

    • PostgreSQLHStoreType

      public PostgreSQLHStoreType()
    • PostgreSQLHStoreType

      public PostgreSQLHStoreType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext)
  • Method Details

    • getSqlType

      public int getSqlType()
    • get

      protected Map get(ResultSet rs, int position, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) throws SQLException
      Description copied from class: ImmutableType
      Get the column value from the JDBC ResultSet.
      Specified by:
      get in class ImmutableType<Map>
      Parameters:
      rs - JDBC ResultSet
      position - database column position
      session - current Hibernate Session
      owner - current Hibernate SessionFactoryImplementor
      Returns:
      column value
      Throws:
      SQLException - in case of failure
    • set

      protected void set(PreparedStatement st, Map value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws SQLException
      Description copied from class: ImmutableType
      Set the column value on the provided JDBC PreparedStatement.
      Specified by:
      set in class ImmutableType<Map>
      Parameters:
      st - JDBC PreparedStatement
      value - database column value
      index - database column index
      session - current Hibernate Session
      Throws:
      SQLException - in case of failure