Class Row

java.lang.Object
org.nuxeo.ecm.core.storage.sql.RowId
org.nuxeo.ecm.core.storage.sql.Row
All Implemented Interfaces:
Serializable, Cloneable, Comparable<RowId>

public final class Row extends RowId implements Serializable, Cloneable
The data of a single row in a table (keys/values form a map), or of multiple rows with the same id (values is an array of Serializable).

The id of the row is distinguished internally from other columns. For fragments corresponding to created data, the initial id is a temporary one, and it will be changed after database insert.

See Also:
  • Field Details

    • OPAQUE

      public static final Serializable OPAQUE
      A database value we don't care about reading. When present in a fragment, it won't be written, but any other value will be.
    • keys

      protected String[] keys
      The row keys, for single row.
    • values

      public Serializable[] values
      The row values.
    • size

      protected int size
      The size of the allocated part of values, for single rows.
    • MAX_STRING

      public static final int MAX_STRING
      See Also:
    • MAX_ARRAY

      public static final int MAX_ARRAY
      See Also:
  • Constructor Details

    • Row

      public Row(String tableName, Serializable id)
      Constructs an empty Row for the given table with the given id (may be null).
    • Row

      public Row(String tableName, Map<String,Serializable> map)
      Constructs a new Row from a map.
      Parameters:
      map - the initial data to use
    • Row

      public Row(String tableName, Serializable id, Serializable[] array)
      Constructs a new Row from an array of values.
      Parameters:
      array - the initial data to use
  • Method Details

    • clone

      public Row clone()
      Overrides:
      clone in class Object
    • isCollection

      public boolean isCollection()
    • put

      public void put(String key, Serializable value)
      Puts a key/value. Does not deal with deltas.
      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, Serializable value, Serializable[] oldvalues)
      Puts a key/value where the current or new value may be a delta. To resolve a delta, the oldvalues (in-database state) must be consulted.
      Parameters:
      key - the key
      value - the value
      oldvalues - the old values
    • putNew

      public void putNew(String key, Serializable value)
      Puts a key/value, assuming the key is not already there.
      Parameters:
      key - the key
      value - the value
    • get

      public Serializable get(String key)
      Gets a value from a key.
      Parameters:
      key - the key
      Returns:
      the value
    • getKeys

      public List<String> getKeys()
      Gets the list of keys. The id is not included.
    • getValues

      public List<Serializable> getValues()
      Gets the list of values. The id is not included.
    • toString

      public String toString()
      Overrides:
      toString in class RowId
    • printValue

      public static void printValue(Serializable value, StringBuilder sb)