com.vladmihalcea.hibernate.type.basic
Class PostgreSQLInetType

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

public class PostgreSQLInetType
extends ImmutableType<Inet>

Maps an Inet object type to a PostgreSQL INET column type.

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

Author:
Vlad Mihalcea
See Also:
Serialized Form

Field Summary
static PostgreSQLInetType INSTANCE
           
 
Constructor Summary
PostgreSQLInetType()
           
 
Method Summary
 Inet get(ResultSet rs, String[] names, org.hibernate.engine.spi.SessionImplementor session, Object owner)
          Get the column value from the JDBC ResultSet.
 void set(PreparedStatement st, Inet 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 PostgreSQLInetType INSTANCE
Constructor Detail

PostgreSQLInetType

public PostgreSQLInetType()
Method Detail

sqlTypes

public int[] sqlTypes()

get

public Inet 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<Inet>
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

public void set(PreparedStatement st,
                Inet 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<Inet>
Parameters:
st - JDBC PreparedStatement
value - database column value
index - database column index
session - current Hibernate Session
Throws:
SQLException - in case of failure


Copyright © 2021. All rights reserved.