Class PostgreSQLPeriodType

java.lang.Object
io.hypersistence.utils.hibernate.type.ImmutableType<Period>
io.hypersistence.utils.hibernate.type.interval.PostgreSQLPeriodType
All Implemented Interfaces:
Serializable, org.hibernate.type.Type, org.hibernate.usertype.EnhancedUserType<Period>, org.hibernate.usertype.UserType<Period>

public class PostgreSQLPeriodType extends ImmutableType<Period>
Maps a Java Period object to a PostgreSQL Interval column type.
Since:
2.6.2
Author:
Jan-Willem Gmelig Meyling, Vlad Mihalcea
See Also:
  • Field Details

  • Constructor Details

    • PostgreSQLPeriodType

      public PostgreSQLPeriodType()
    • PostgreSQLPeriodType

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

    • get

      protected Period 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<Period>
      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

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

      public int getSqlType()
    • fromStringValue

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