Class PostgreSQLInetType

  • All Implemented Interfaces:
    java.io.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.

    See Also:
    Serialized Form
    • Constructor Detail

      • PostgreSQLInetType

        public PostgreSQLInetType()
    • Method Detail

      • sqlTypes

        public int[] sqlTypes()
      • get

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

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