Class CommitTimestamp
java.lang.Object
com.google.cloud.spring.data.spanner.core.convert.CommitTimestamp
The factory method
of(Class)
should be used to resolve a specific value of a pointed
class which is converted then to the Value.COMMIT_TIMESTAMP
by CommitTimestamp.CommitTimestampDecorator
. It should be used when a database column has type of Timestamp with an
option "allow_commit_timestamp" and the business logic needs to manage in runtime when the
PENDING_COMMIT_TIMESTAMP should be stored into this field.- Since:
- 1.2.2
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A specific decorator of the "to timestamp" function that any custom converter should follow to support "CommitTimestamp" feature. -
Method Summary
-
Method Details
-
of
Creates a value forValue.COMMIT_TIMESTAMP
.- Type Parameters:
T
- type of the class. Supported by-default types are:Timestamp
,Timestamp
,LocalDateTime
,Instant
,Date
.- Parameters:
timestampClass
- a class to be presented as a Timestamp in the database column.- Returns:
- a value that will be converted to
Value.COMMIT_TIMESTAMP
bySpannerConverters
- Throws:
IllegalArgumentException
- when thetimestampClass
was not registered.
-