Class Datetime.Timestamp.AsLocalDateTime
- All Implemented Interfaces:
Adapter.Contract<LocalDateTime>
,Adapter.Contract.Scalar<LocalDateTime>
,Datetime.Timestamp<LocalDateTime>
- Enclosing interface:
Datetime.Timestamp<T>
LocalDateTime
.
The PostgreSQL "-infinity" and "+infinity" values are mapped to
LocalDateTime
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.Timestamp
Datetime.Timestamp.AsLocalDateTime, Datetime.Timestamp.Modifier<T>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Datetime.Timestamp.AsLocalDateTime
static final LocalDateTime
LocalDateTime
representing PostgreSQL's "infinitely early" timestamp.static final LocalDateTime
LocalDateTime
representing PostgreSQL's "infinitely late" timestamp.Fields inherited from interface org.postgresql.pljava.adt.Datetime.Timestamp
POSTGRES_EPOCH
-
Method Summary
Modifier and TypeMethodDescriptionconstruct
(long microsecondsSincePostgresEpoch) Constructs a representation T from the components of the PostgreSQL data type.<T> T
store
(LocalDateTime d, Datetime.Timestamp<T> f)
-
Field Details
-
INSTANCE
-
NOBEGIN
LocalDateTime
representing PostgreSQL's "infinitely early" timestamp. -
NOEND
LocalDateTime
representing PostgreSQL's "infinitely late" timestamp.
-
-
Method Details
-
construct
Description copied from interface:Datetime.Timestamp
Constructs a representation T from the components of the PostgreSQL data type.The argument represents microseconds since midnight on
POSTGRES_EPOCH
.Because no particular time zone is understood to apply, the exact corresponding point on a standard timeline cannot be identified, absent outside information. It is typically used to represent a timestamp in the local zone, whatever that is.
The argument represents microseconds since
POSTGRES_EPOCH
, unless it is one of the special valuesDT_NOBEGIN
orDT_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.Timestamp<LocalDateTime>
-
store
- Throws:
SQLException
-