Class CommitTimestamp

java.lang.Object
com.google.cloud.spring.data.spanner.core.convert.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.
Since:
1.2.2
  • 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.
      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 by SpannerConverters
      Throws:
      IllegalArgumentException - when the timestampClass was not registered.