com.vladmihalcea.hibernate.type.basic
Class PostgreSQLHStoreType

java.lang.Object
  extended by com.vladmihalcea.hibernate.type.ImmutableType<Map>
      extended by com.vladmihalcea.hibernate.type.basic.PostgreSQLHStoreType
All Implemented Interfaces:
Serializable, org.hibernate.type.Type, org.hibernate.usertype.UserType

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:
Serialized Form

Field Summary
static PostgreSQLHStoreType INSTANCE
           
 
Constructor Summary
PostgreSQLHStoreType()
           
 
Method Summary
protected  Map get(ResultSet rs, String[] names, org.hibernate.engine.spi.SessionImplementor session, Object owner)
          Get the column value from the JDBC ResultSet.
protected  void set(PreparedStatement st, Map value, int index, org.hibernate.engine.spi.SessionImplementor session)
          Set the column value on the provided JDBC PreparedStatement.
 int[] sqlTypes()
           
 
Methods inherited from class com.vladmihalcea.hibernate.type.ImmutableType
assemble, assemble, beforeAssemble, compare, deepCopy, deepCopy, defaultSizes, dictatedSizes, disassemble, disassemble, equals, getColumnSpan, getConfiguration, getHashCode, getHashCode, getName, getReturnedClass, getSemiResolvedType, hashCode, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, replace, replace, replace, resolve, returnedClass, semiResolve, sqlTypes, toColumnNullness, toLoggableString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final PostgreSQLHStoreType INSTANCE
Constructor Detail

PostgreSQLHStoreType

public PostgreSQLHStoreType()
Method Detail

sqlTypes

public int[] sqlTypes()

get

protected Map get(ResultSet rs,
                  String[] names,
                  org.hibernate.engine.spi.SessionImplementor 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
names - database column name
session - current Hibernate Session
owner - current Hibernate SessionFactory
Returns:
column value
Throws:
SQLException - in case of failure

set

protected void set(PreparedStatement st,
                   Map value,
                   int index,
                   org.hibernate.engine.spi.SessionImplementor 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


Copyright © 2020. All rights reserved.