Class NullableCharacterType

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

    public class NullableCharacterType
    extends ImmutableType<java.lang.Character>
    Maps an Character to a nullable CHAR column type.

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

    See Also:
    Serialized Form
    • Constructor Detail

      • NullableCharacterType

        public NullableCharacterType()
    • Method Detail

      • sqlTypes

        public int[] sqlTypes()
      • get

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