Class PostgreSQLInetType

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

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:
  • Field Details

  • Constructor Details

    • PostgreSQLInetType

      public PostgreSQLInetType()
    • PostgreSQLInetType

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

    • getSqlType

      public int getSqlType()
    • get

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

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

      public Inet fromStringValue(CharSequence sequence) throws org.hibernate.HibernateException
      Throws:
      org.hibernate.HibernateException