com.sap.ip.me.api.smartsync
Interface Row


public interface Row

A Row is a data repository object having a set of fields represented by array or Field objects. One of the field instance serves as a key field that is assigned a globally unique value.

Examples:

Getting a Field instance from an existing Row:

   //retrieving a field instance from a Row using the FieldDescriptor
   Field delvDateField = existingRow.getField(delvDateFieldDescriptor);
   
   //retrieving the Row's key field
   Field keyField = existingRow.getKeyField();
 

Retrieving the relating Row objects to this Row using Query:

   //retrieving all relating Row objects whose delvDate field is greater than 1999-12-25
   Condition condition = queryFactory.createCondition(delvDateFieldDescriptor, RelationalOperatorType.GREATER_THAN, java.sql.Date.valueOf("1999-12-25"));
   Query query = queryFactory.createQuery(rowDescriptor, condition);
   RowList resultingList = thisRow.getRelatingRows(query);
 
   //retrieving all relating Row objects whose delvDate field is greater than 1999-12-25 and delvTime equals to 12:00:00
   Condition dateCondition = queryFactory.createCondition(delvDateFieldDescriptor, RelationalOperatorType.GREATER_THAN, java.sql.Date.valueOf("1999-12-25"));
   Condition timeCondition = queryFactory.createCondition(delvTimeFieldDescriptor, RelationalOperatorType.EQUALS, java.sql.Time.valueOf("12:00:00"));
   Condition condition = queryFactory.createCondition(new Condition[]{dateCondition, timeCondition}, LogicalOperatorType.AND);
   Query query = queryFactory.createQuery(rowDescriptor, condition);
   RowList resultingList = thisRow.getRelatingRows(query);   
 

Version:
2.1
Author:
SAP

Method Summary
 Row createInitialCopy()
          Returns a copy of Row.
 Row createUnlinkedCopy()
          Deprecated. use modifyFieldValue(FieldDescriptor, Object) in conjunction with SyncBo.modifyRow(Row).
 CharacterField getCharacterField(FieldDescriptor fieldDescriptor)
          Retrieve a StringField object for a specific FieldDescriptor.
 DateField getDateField(FieldDescriptor fieldDescriptor)
          Retrieve a DateField object for a specific FieldDescriptor.
 DecimalField getDecimalField(FieldDescriptor fieldDescriptor)
          Retrieve a DecimalField object for a specific FieldDescriptor.
 Field getField(FieldDescriptor fieldDescriptor)
          Retrieve a Field object for a specific FieldDescriptor.
 Field[] getFields()
          Retrieve the array of Field objects of this Row.
 java.lang.Object getFieldValue(FieldDescriptor fieldDescriptor)
          Deprecated. since 2.5. Use new MI 2.5 data types in conjunction with Field.getValue() instead.
 MeIterator getFieldValues()
          Returns an iterator for the field values of this Row object
 Field[] getGroupFields(FieldGroupDescriptor fieldGroupDescriptor)
          Returns the array of Field objects that are of the same groups as specified in the FieldGroupDescriptor
 java.lang.String getKey()
          Returns the key field value of this Row object.
 Field getKeyField()
          Returns the Field instance of the key field value
 NumericField getNumericField(FieldDescriptor fieldDescriptor)
          Retrieve a NumericField object for a specific FieldDescriptor.
 Row getRelatedRow(RowDescriptor relatedRow)
          Returns the Row instance of the related Row described by the specified RowDescriptor.
 RowList getRelatingRows(Query query)
          Returns a list of the Row objects complying to the specified Query relating to this Row
 RowList getRelatingRows(RowDescriptor relatingRowDescriptor)
          Returns a list of the Row objects relating to this Row.
 RowDescriptor getRowDescriptor()
          Returns the RowDescriptor attribute of this Row object
 StatusType getStatus()
          Returns the status attribute of this Row object.
 SyncBo getSyncBo()
          Returns the SyncBo object which this Row instance belongs to
 java.math.BigInteger getSyncBoKey()
          Gets the sync key of the corresponding SyncBo
 java.lang.String getSyncKey()
           
 TimeField getTimeField(FieldDescriptor fieldDescriptor)
          Retrieve a TimeField object for a specific FieldDescriptor.
 void modifyFieldValue(FieldDescriptor field, java.lang.Object fieldValue)
          Modifies the field value of this Row.
 void setFieldValue(FieldDescriptor fieldDescriptor, java.lang.Object fieldValue)
          Deprecated. use modifyFieldValue(FieldDescriptor, Object)
 

Method Detail

getRowDescriptor

public RowDescriptor getRowDescriptor()
Returns the RowDescriptor attribute of this Row object

Returns:
a RowDescriptor value

getFieldValue

public java.lang.Object getFieldValue(FieldDescriptor fieldDescriptor)
Deprecated. since 2.5. Use new MI 2.5 data types in conjunction with Field.getValue() instead.

Returns the field value for the specified FieldDescriptor instance. The returned value is represented as an Object instance. Smart Sync recommends applications to use Row.getField or other get specific Field methods instead of using the method.

Parameters:
fieldDescriptor - the FieldDescriptor of the field value to be retrieved
Returns:
the field value for the specifed FieldDescriptor
See Also:
for the returned data types in 2.1 version

getFieldValues

public MeIterator getFieldValues()
Returns an iterator for the field values of this Row object

Returns:
a field values iterator for this Row

setFieldValue

public void setFieldValue(FieldDescriptor fieldDescriptor,
                          java.lang.Object fieldValue)
                   throws ModificationNotAllowedException,
                          PersistenceException
Deprecated. use modifyFieldValue(FieldDescriptor, Object)

Sets the field value of the specified FieldDescriptor parameter for this Row instance. As of version 2.5, this method is deprecated and new SmartSync data types were introduced. To access data in their new data types, use Field.getValue and Field.setValue accessor methods.

Parameters:
fieldDescriptor - the FieldDescriptor of the field attribute to be modified
fieldValue - the new field value to be set
Throws:
ModificationNotAllowedException - is thrown for the following cases:
  • if the specified FieldDescriptor belongs to the key field
  • if the SyncBo which this Row belongs and the Row itself have a GLOBAL status and the SyncBo's modify permission is false.
  • if the SyncBo which this Row belongs is in synchronization state i.e. having an IN_SYNC status.
NOTE:
From 2.1 SP02, the data validity check is left to the application side. The application may use the FieldDescriptor.checkFieldValue method to verify the field value to be set.
use instead.
PersistenceException - is thrown if a persistent related error occurred during the value update
See Also:
for the data type mapping in 2.1 version

getRelatingRows

public RowList getRelatingRows(RowDescriptor relatingRowDescriptor)
                        throws PersistenceException
Returns a list of the Row objects relating to this Row.

Parameters:
relatingRowDescriptor - the RowDescriptor of the Row object instance
Returns:
a static list of all the Row objects that relate to this Row
Throws:
PersistenceException - is thrown if a persistent related error occurred during the attribute retrieval

getRelatingRows

public RowList getRelatingRows(Query query)
                        throws PersistenceException
Returns a list of the Row objects complying to the specified Query relating to this Row

Parameters:
query - the Query instance specifying the criteria of the Row objects to be returned
Returns:
a static list of all the Row objects that relate to this Row
Throws:
PersistenceException - is thrown if a persistent related error occurred during the attribute retrieval
Since:
2.5

getRelatedRow

public Row getRelatedRow(RowDescriptor relatedRow)
                  throws PersistenceException
Returns the Row instance of the related Row described by the specified RowDescriptor.

Parameters:
relatedRow - the RowDescriptor of the Row object related to this Row instance
Returns:
a Row object related to this Row instance
Throws:
PersistenceException - is thrown if a persistent related error occurred during the attribute retrieval

getSyncBo

public SyncBo getSyncBo()
                 throws PersistenceException
Returns the SyncBo object which this Row instance belongs to

Returns:
a SyncBo object referenced by this Row object
Throws:
PersistenceException - is thrown if a persistent related error occurred during the object retrieval

createUnlinkedCopy

public Row createUnlinkedCopy()
Deprecated. use modifyFieldValue(FieldDescriptor, Object) in conjunction with SyncBo.modifyRow(Row).

Returns a clone of Row. The clone has following characteristics:
  • The field values are also cloned. This also implies that the unique key remains the same.
  • The clone has no link to the repository. This means that modifications to the clone are not updated in the repository, unless the clone itself is passed to replace a Row object in a SyncBo in the repository thru SyncBo.replaceRow(Row row) . NOTE:
    An initial copy will be returned if the Row to be copied has an INITIAL status.

    Returns:
    a Row instance copy having similar field keys and values

  • createInitialCopy

    public Row createInitialCopy()
    Returns a copy of Row. The copy has following characteristics:
  • The field value objects are also cloned but the unique key field value is initialized.
  • The clone has no link to the repository.This means that modifications to the clone are not updated in the repository, unless the clone itself is inserted into the SyncBo instance thru SyncBo.insertRow(Row row) .

    Returns:
    Description of the Return Value

  • getKey

    public java.lang.String getKey()
    Returns the key field value of this Row object.

    Returns:
    the field key value

    getStatus

    public StatusType getStatus()
    Returns the status attribute of this Row object.
    Both SyncBo and Row have status attribute, they may be different in some cases, such as SyncBo status is GLOBAL, but row status is LOCAL for example.

    Returns:
    the StatusType instance of this Row object
    See Also:
    StatusType

    getField

    public Field getField(FieldDescriptor fieldDescriptor)
                   throws SmartSyncException
    Retrieve a Field object for a specific FieldDescriptor.

    Parameters:
    fieldDescriptor - descriptor for identification a field
    Returns:
    the Field instance of this Row object
    Throws:
    SmartSyncException
    Since:
    2.5
    See Also:
    Field

    getKeyField

    public Field getKeyField()
                      throws SmartSyncException
    Returns the Field instance of the key field value

    Returns:
    the key Field instance
    Throws:
    SmartSyncException
    Since:
    2.5

    getFields

    public Field[] getFields()
    Retrieve the array of Field objects of this Row.

    Returns:
    the array of Field objects of this Row instance
    Since:
    2.5
    See Also:
    Field

    getDateField

    public DateField getDateField(FieldDescriptor fieldDescriptor)
                           throws SmartSyncException
    Retrieve a DateField object for a specific FieldDescriptor.

    Parameters:
    fieldDescriptor - descriptor for identification a field
    Returns:
    the Field instance of this Row object
    Throws:
    SmartSyncException
    Since:
    2.5
    See Also:
    Field

    getTimeField

    public TimeField getTimeField(FieldDescriptor fieldDescriptor)
                           throws SmartSyncException
    Retrieve a TimeField object for a specific FieldDescriptor.

    Parameters:
    fieldDescriptor - descriptor for identification a field
    Returns:
    the Field instance of this Row object
    Throws:
    SmartSyncException
    Since:
    2.5
    See Also:
    Field

    getNumericField

    public NumericField getNumericField(FieldDescriptor fieldDescriptor)
                                 throws SmartSyncException
    Retrieve a NumericField object for a specific FieldDescriptor.

    Parameters:
    fieldDescriptor - descriptor for identification a field
    Returns:
    the Field instance of this Row object
    Throws:
    SmartSyncException
    Since:
    2.5
    See Also:
    Field

    getDecimalField

    public DecimalField getDecimalField(FieldDescriptor fieldDescriptor)
                                 throws SmartSyncException
    Retrieve a DecimalField object for a specific FieldDescriptor.

    Parameters:
    fieldDescriptor - descriptor for identification a field
    Returns:
    the Field instance of this Row object
    Throws:
    SmartSyncException
    Since:
    2.5
    See Also:
    Field

    getCharacterField

    public CharacterField getCharacterField(FieldDescriptor fieldDescriptor)
                                     throws SmartSyncException
    Retrieve a StringField object for a specific FieldDescriptor.

    Parameters:
    fieldDescriptor - descriptor for identification a field
    Returns:
    the Field instance of this Row object
    Throws:
    SmartSyncException
    Since:
    2.5
    See Also:
    Field

    getGroupFields

    public Field[] getGroupFields(FieldGroupDescriptor fieldGroupDescriptor)
                           throws SmartSyncException
    Returns the array of Field objects that are of the same groups as specified in the FieldGroupDescriptor

    Parameters:
    fieldGroupDescriptor - the FieldGroupDescriptor instance
    Returns:
    an array of Field objects that are of the same groups as specified in the FieldGroupDescriptor
    Throws:
    SmartSyncException - if the specified fieldGroupDescriptor is not defined for this Row.
    Since:
    2.5

    getSyncKey

    public java.lang.String getSyncKey()
    Returns:

    getSyncBoKey

    public java.math.BigInteger getSyncBoKey()
    Gets the sync key of the corresponding SyncBo

    Returns:
    the sync key of the corresponding SyncBo

    modifyFieldValue

    public void modifyFieldValue(FieldDescriptor field,
                                 java.lang.Object fieldValue)
                          throws ModificationNotAllowedException
    Modifies the field value of this Row. The difference between setFieldValue(FieldDescriptor, Object) is that this method does the modification only transient on this object. To persist the change you need to call SyncBo.modifyRow(Row) with this Row as parameter.

    Parameters:
    field -
    fieldValue -
    Throws:
    ModificationNotAllowedException


    Copyright © 2005 SAP AG. All Rights Reserved.