Interface Datetime.Date<T>

All Superinterfaces:
Adapter.Contract<T>, Adapter.Contract.Scalar<T>
All Known Implementing Classes:
Datetime.Date.AsLocalDate
Enclosing interface:
Datetime
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Datetime.Date<T> extends Adapter.Contract.Scalar<T>
The DATE type's PostgreSQL semantics: a signed number of days since the "Postgres epoch".
  • Field Details

    • POSTGRES_EPOCH

      static final LocalDate POSTGRES_EPOCH
      The PostgreSQL "epoch" as a java.time.LocalDate.
  • Method Details

    • construct

      T construct(int daysSincePostgresEpoch)
      Constructs a representation T from the components of the PostgreSQL data type.

      The argument represents days since POSTGRES_EPOCH, unless it is one of the special values DATEVAL_NOBEGIN or DATEVAL_NOEND.

      When constructing a representation that lacks notions of positive or negative "infinity", one option is to simply map the above special values no differently than ordinary ones, and remember the two resulting representations as the "infinite" ones. If that is done without wraparound, the resulting "-infinity" value will precede all other PostgreSQL-representable dates and the resulting "+infinity" will follow them.

      The older java.util.Date cannot represent those values without wraparound; the two resulting values can still be saved as representing -infinity and +infinity, but will not have the expected ordering with respect to other values. They will both be quite far from the present.