Class PostgreSQLPeriodType

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

    public class PostgreSQLPeriodType
    extends ImmutableType<java.time.Period>
    Maps a Java Duration object to a PostgreSQL Interval column type.
    Since:
    2.6.2
    See Also:
    Serialized Form
    • Constructor Detail

      • PostgreSQLPeriodType

        public PostgreSQLPeriodType()
    • Method Detail

      • get

        protected java.time.Period 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.time.Period>
        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

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

        public int[] sqlTypes()