Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.storage.sql
Class Row

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.RowId
      extended by org.nuxeo.ecm.core.storage.sql.Row
All Implemented Interfaces:
java.io.Serializable

public final class Row
extends RowId
implements java.io.Serializable

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:
Serialized Form

Field Summary
static int MAX_ARRAY
           
static int MAX_STRING
           
 java.io.Serializable[] values
          The row values.
 
Fields inherited from class org.nuxeo.ecm.core.storage.sql.RowId
id, tableName
 
Constructor Summary
Row(java.lang.String tableName, java.util.Map<java.lang.String,java.io.Serializable> map)
          Constructs a new Row from a map.
Row(java.lang.String tableName, java.io.Serializable id)
          Constructs an empty Row for the given table with the given id (may be null).
Row(java.lang.String tableName, java.io.Serializable id, java.io.Serializable[] array)
          Constructs a new Row from an array of values.
 
Method Summary
 Row clone()
           
 java.io.Serializable get(java.lang.String key)
          Gets a value from a key.
 java.util.List<java.lang.String> getKeys()
          Gets the list of keys.
 java.util.List<java.io.Serializable> getValues()
          Gets the list of values.
 boolean isCollection()
           
static void printValue(java.io.Serializable value, java.lang.StringBuilder buf)
           
 void put(java.lang.String key, java.io.Serializable value)
          Puts a key/value.
 void putNew(java.lang.String key, java.io.Serializable value)
          Puts a key/value, assuming the key is not already there.
 java.lang.String toString()
           
 
Methods inherited from class org.nuxeo.ecm.core.storage.sql.RowId
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

values

public java.io.Serializable[] values
The row values.


MAX_STRING

public static final int MAX_STRING
See Also:
Constant Field Values

MAX_ARRAY

public static final int MAX_ARRAY
See Also:
Constant Field Values
Constructor Detail

Row

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


Row

public Row(java.lang.String tableName,
           java.util.Map<java.lang.String,java.io.Serializable> map)
Constructs a new Row from a map.

Parameters:
map - the initial data to use

Row

public Row(java.lang.String tableName,
           java.io.Serializable id,
           java.io.Serializable[] array)
Constructs a new Row from an array of values.

Parameters:
array - the initial data to use
Method Detail

clone

public Row clone()
Overrides:
clone in class java.lang.Object

isCollection

public boolean isCollection()

put

public void put(java.lang.String key,
                java.io.Serializable value)
Puts a key/value.

Parameters:
key - the key
value - the value

putNew

public void putNew(java.lang.String key,
                   java.io.Serializable value)
Puts a key/value, assuming the key is not already there.

Parameters:
key - the key
value - the value

get

public java.io.Serializable get(java.lang.String key)
Gets a value from a key.

Parameters:
key - the key
Returns:
the value

getKeys

public java.util.List<java.lang.String> getKeys()
Gets the list of keys. The id is not included.


getValues

public java.util.List<java.io.Serializable> getValues()
Gets the list of values. The id is not included.


toString

public java.lang.String toString()
Overrides:
toString in class RowId

printValue

public static void printValue(java.io.Serializable value,
                              java.lang.StringBuilder buf)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.