Class CommitTimestamp


public final class CommitTimestamp extends Object
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.
  • Method Details

    • of

      public static <T> T of(Class<T> timestampClass)
      Creates a value for Value.COMMIT_TIMESTAMP.
      Type Parameters:
      T - type of the class. Supported by-default types are: Timestamp, Timestamp, LocalDateTime, Instant, Date.
      timestampClass - a class to be presented as a Timestamp in the database column.
      a value that will be converted to Value.COMMIT_TIMESTAMP by SpannerConverters
      IllegalArgumentException - when the timestampClass was not registered.