Class PostgreSQLHStoreType

  • All Implemented Interfaces:
    java.io.Serializable, org.hibernate.type.Type, org.hibernate.usertype.UserType

    public class PostgreSQLHStoreType
    extends ImmutableType<java.util.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.

    See Also:
    Serialized Form
    • Constructor Detail

      • PostgreSQLHStoreType

        public PostgreSQLHStoreType()
    • Method Detail

      • sqlTypes

        public int[] sqlTypes()
      • get

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

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