Interface Row

All Superinterfaces:
Comparable<FieldValue>, FieldValue, RecordValue
All Known Subinterfaces:
PrimaryKey, ReturnRow

public interface Row extends RecordValue
Row is a specialization of RecordValue to represent a single record, or row, in a table. It is a central object used in most table operations defined in TableAPI.

Row objects are constructed explicitly using createRow or implicitly when returned from table access operations.

Since:
3.0
  • Method Details

    • getTable

      Table getTable()
      Return the Table associated with this row.
      Returns:
      the Table
    • getVersion

      Version getVersion()
      Returns the Version for the row. The description of Version in its class description refers to its use in the KVStore interface. In TableAPI it it used as a return value for the various put methods as well as TableAPI.putIfVersion(oracle.kv.table.Row, oracle.kv.Version, oracle.kv.table.ReturnRow, oracle.kv.table.WriteOptions) and TableAPI.deleteIfVersion(oracle.kv.table.PrimaryKey, oracle.kv.Version, oracle.kv.table.ReturnRow, oracle.kv.table.WriteOptions) to perform conditional updates to allow an application to ensure that an update is occurring on the desired version of a row.
      Returns:
      the Version object if it has been initialized, null otherwise. The Version will only be set if the row was retrieved from the store.
    • createPrimaryKey

      PrimaryKey createPrimaryKey()
      Creates a PrimaryKey from this Row. The non-key fields are removed.
      Returns:
      the PrimaryKey
    • getTableVersion

      int getTableVersion()
      Returns the version of the table used to create this row if it has been deserialized from a get operation. If the row has been created and never been serialized the version returned is 0. New Table versions are created when a table is schema evolved. Tables start out with version 1 and it increments with each change. This method can be used by applications to help handle version changes.
    • equals

      boolean equals(Object other)
      Equality comparison for Row instances is based on equality of the individual field values and ignores the included Version, if present.
      Overrides:
      equals in class Object
      Returns:
      true if the objects are equal
    • clone

      Row clone()
      Returns a deep copy of this object.
      Specified by:
      clone in interface FieldValue
      Specified by:
      clone in interface RecordValue
      Returns:
      a deep copy of this object
    • setTTL

      void setTTL(TimeToLive ttl)
      Sets a time to live (TTL) value for the row to be used when the row is inserted into a store. If not set, or if the value is null, the table default value will be used. If no expiration time is desired, a TimeToLive instance of duration 0 should be used. The constant, TimeToLive.DO_NOT_EXPIRE, exists as a convenience for that purpose.

      It is recommended that the TimeToLive be constructed using TimeToLive.ofDays(long) to use less space in the store. If hours are needed then TimeToLive.ofHours(long) can be used at the expense of additional storage used.

      Parameters:
      ttl - the value to use, may be null
      Throws:
      IllegalArgumentException - if the TimeToLive is negative
      Since:
      4.0
    • getTTL

      TimeToLive getTTL()
      Returns the time to live (TTL) value for this row or null if it has not been set by a call to setTTL(oracle.kv.table.TimeToLive). If this is null it means that the table default will be used on a put operation. The TTL property of a Row is used only on input. The expiration time of a Row is available on output, or after a put operation using getExpirationTime().
      Returns:
      the TimeToLive for the row or null if not set
      Since:
      4.0
    • getExpirationTime

      long getExpirationTime()
      Returns the expiration time of the row. A zero value indicates that the row does not expire or has not yet been set. The expiration time is set if this row was returned by a get (e.g. TableAPI.get(oracle.kv.table.PrimaryKey, oracle.kv.table.ReadOptions)) or table iterator (e.g. TableAPI.tableIterator(oracle.kv.table.PrimaryKey, oracle.kv.table.MultiRowOptions, oracle.kv.table.TableIteratorOptions)) call. It will also be set after a successful put of the row (e.g. TableAPI.put(oracle.kv.table.Row, oracle.kv.table.ReturnRow, oracle.kv.table.WriteOptions).
      Returns:
      the expiration time in milliseconds since January 1, 1970 GMT, or zero if the record never expires
      Since:
      4.0
    • getCreationTime

      long getCreationTime()
      Returns the creation time of the row or zero if it is not available. If the row was written before the system compatibility state is enabled for version 26.1, the creation time is ill-defined and not useful.

      The creation time is set automatically by the server when the row is first successfully created.

      Returns:
      the creation time in milliseconds since the epoch January 1st, 1970 GMT or 0 if not available.
      Since:
      26.1
    • getLastModificationTime

      long getLastModificationTime()
      Returns the last modification time of the row or zero if it is not available or not yet set. If the row was written by a version of the system older than 19.5 the last modification time will not be available at all and will be zero.

      The modification time is set if this row was returned by a get (e.g. TableAPI.get(oracle.kv.table.PrimaryKey, oracle.kv.table.ReadOptions)) or table iterator (e.g. TableAPI.tableIterator(oracle.kv.table.PrimaryKey, oracle.kv.table.MultiRowOptions, oracle.kv.table.TableIteratorOptions)) call. It will also be valid after a successful put of the row (e.g. TableAPI.put(oracle.kv.table.Row, oracle.kv.table.ReturnRow, oracle.kv.table.WriteOptions)).

      Returns:
      the last update time in milliseconds since January 1st, 1970 GMT or 0 if not available.
      Since:
      22.1
    • setLastWriteMetadata

      void setLastWriteMetadata(String lastWriteMetadata)
      Sets the metadata associated with the last write operation for the row (insert or update operations) or primary key (for delete operations). If not specified null will be used by default.

      NOTE that the metadata describes the last write operation, NOT the row. For example, a new write operation without providing the metadata clears the previous value.

      Parameters:
      lastWriteMetadata - the metadata, must be a valid JSON construct (representing object, array, string, number, true, false or null values) or null.
      Throws:
      IllegalArgumentException - if lastWriteMetadata is not null or a valid JSON construct format
      Since:
      26.1
    • getLastWriteMetadata

      String getLastWriteMetadata()
      Returns the metadata associated with the last write of the row.
      Returns:
      the metadata associated with the last write, or null if not set
      Since:
      26.1