- All Implemented Interfaces:
Adapter.Contract<LocalDate>
,Adapter.Contract.Scalar<LocalDate>
,Datetime.Date<LocalDate>
- Enclosing interface:
Datetime.Date<T>
LocalDate
.
The PostgreSQL "-infinity" and "+infinity" values are mapped to
LocalDate
instances matching (by equals
) the special
instances NOBEGIN
and NOEND
here, respectively.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.postgresql.pljava.Adapter.Contract
Adapter.Contract.Array<T,
E, A extends Adapter<E, ?>>, Adapter.Contract.Scalar<T> Nested classes/interfaces inherited from interface org.postgresql.pljava.adt.Datetime.Date
Datetime.Date.AsLocalDate
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Datetime.Date.AsLocalDate
static final LocalDate
LocalDate
representing PostgreSQL's "infinitely early" date.static final LocalDate
LocalDate
representing PostgreSQL's "infinitely late" date.Fields inherited from interface org.postgresql.pljava.adt.Datetime.Date
POSTGRES_EPOCH
-
Method Summary
Modifier and TypeMethodDescriptionconstruct
(int daysSincePostgresEpoch) Constructs a representation T from the components of the PostgreSQL data type.<T> T
store
(LocalDate d, Datetime.Date<T> f)
-
Field Details
-
INSTANCE
-
NOBEGIN
LocalDate
representing PostgreSQL's "infinitely early" date. -
NOEND
LocalDate
representing PostgreSQL's "infinitely late" date.
-
-
Method Details
-
construct
Description copied from interface:Datetime.Date
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 valuesDATEVAL_NOBEGIN
orDATEVAL_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.- Specified by:
construct
in interfaceDatetime.Date<LocalDate>
-
store
- Throws:
SQLException
-