com.sap.mdm.data
Interface Record

All Superinterfaces:
Cloneable, RepositoryItem
All Known Subinterfaces:
BinaryBlobRecord, BlobRecord, HierNode, HierNodeEx, ImageBlobRecord, PdfBlobRecord, RecordEx, TextBlobRecord

public interface Record
extends RepositoryItem, Cloneable

This interface represents record in MDM repository. Is supplies methods for getting and setting values for all record elements: fields, taxonomy attributes, qualifiers.

See Also:
HierNode, RecordResultSet

Nested Class Summary
static interface Record.CheckoutStatus
          Constants for Check-out Status of Record
static interface Record.MatrixType
          Constants for record matrix type
static interface Record.ModificationStatus
          Constants for Modification Status of Record
 
Method Summary
 Object clone()
          Returns a clone.
 boolean containsAttribute(FieldId taxonomyFieldId, AttributeId attrId)
          Check if specified attribute is populate with data
 boolean containsField(FieldId fieldId)
          Check if specified field is populate with data
 Record[] findLookupRecords(FieldId lookupFieldId)
          Find supported lookup record (or records for multi-value case) in cache of result set for the specified lookup field.
 AttributeId[] getAttributes(FieldId taxonomyFieldId)
          Get array of attribute IDs for the specified taxonomy field.
 MdmValue getAttributeValue(FieldId taxonomyFieldId, AttributeId attrId)
          Get value of the specified attribute for taxonomy field.
 int getChangeStamp()
          Get change stamp of the record
 int getCheckoutStatus()
          Get checkout status
 String getDefaultRegionCode()
          Returns the default region code.
 String getDisplayValue()
          Get display value of this record.
 FieldId[] getFields()
          Get array of field IDs for all populated records.
 MdmValue getFieldValue(FieldId fieldId)
          Get value of the specified field.
 RecordId getId()
          Get record ID
 String getLookupDisplayValue(FieldId lookupFieldId)
          Returns display value for lookup field
 int getMatrixType()
          Returns the matrix type.
 TableSchema getMetadata()
          Get metadata of table the current record belongs to.
 int getModificationStatus()
          Get modification status (NEW, MODIFIED, UNMODIFIED)
 MultiregionValue getMultiregionFieldValue(FieldId fieldId)
          Get multi-region value of the specified field.
 Record[] getReverseLookupRecords(ReverseLookupId reverseLookup)
          Gets the value of the specified reverse lookup field, which is an array of records that reference this record.
 ReverseLookupId[] getReverseLookups()
          Returns the reverse lookups specified for the record.
 TableId getTable()
          Get ID of the table the current record belongs to.
 String getTupleDisplayValue(FieldId tupleFieldId)
          Returns the display value for the tuple field.
 boolean hasFieldValue(FieldId fieldId)
          Returns whether the specified field has field value, meaning not null.
 boolean isInWorkflow()
          Returns whether the record is in a work flow.
 boolean isProtected()
          Check if the this record is protected
 boolean isQualifiedField(FieldId fieldId)
          Indicates if specified field is qualified lookup field
 boolean isTaxonomyField(FieldId fieldId)
          Indicates if the specified record field is taxonomy field
 void setAttributeValue(FieldId taxonomyFieldId, AttributeId attrId, MdmValue value)
          Set new value to the specified attribute for taxonomy field.
 void setFieldValue(FieldId fieldId, MdmValue value)
          Set new value to the specified field.
 void setMatrixType(int matrixType)
          Sets the matrix type.
 String toString(FieldId fieldId)
          Converts specified field value to string; this is the short form of the method.
 String toString(FieldId fieldId, AttributeId attributeId)
          Converts the specified attribute value to string; this is the short form of the method.
 String toString(FieldId fieldId, AttributeId attributeId, int regionInheritanceMode, RegionInheritanceProperties regionInheritance, DimensionsManager dm)
          Converts the specified attribute value to string according to the specified parameters; this is the long form of the method.
 String toString(FieldId fieldId, int regionInheritanceMode, RegionInheritanceProperties regionInheritance, DimensionsManager dm)
          Converts the specified field value to a string according to the specified parameters; this is the long form of the method.
 

Method Detail

getId

public RecordId getId()
Get record ID

Returns:
record ID or null if record is new

getTable

public TableId getTable()
Get ID of the table the current record belongs to.

Returns:
table ID

getChangeStamp

public int getChangeStamp()
Get change stamp of the record

Returns:
change stamp. Return -1 if record is new

getMetadata

public TableSchema getMetadata()
Get metadata of table the current record belongs to.

Returns:
table metadata. Returns Null if metadata was not loaded.

getDisplayValue

public String getDisplayValue()
Get display value of this record. Display value is string compounded on the server side from display field values. For new record return Null

Returns:
record display value. Null for new record.

isProtected

public boolean isProtected()
Check if the this record is protected

Returns:
true if record is protected, false otherwise

isInWorkflow

public boolean isInWorkflow()
Returns whether the record is in a work flow.

Returns:
true if in workflow, otherwise false
Since:
7.3

getCheckoutStatus

public int getCheckoutStatus()
Get checkout status

Returns:
checkout status
See Also:
Record.CheckoutStatus

getMatrixType

public int getMatrixType()
Returns the matrix type.

Returns:
a matrix type
See Also:
Record.MatrixType

setMatrixType

public void setMatrixType(int matrixType)
Sets the matrix type. The default is Record.MatrixType.ORDINARY.

Parameters:
matrixType - a matrix type

getModificationStatus

public int getModificationStatus()
Get modification status (NEW, MODIFIED, UNMODIFIED)

Returns:
modification status

getFields

public FieldId[] getFields()
Get array of field IDs for all populated records.

Returns:
array of field IDs. Empty array is returned if any field was populated

getFieldValue

public MdmValue getFieldValue(FieldId fieldId)
                       throws IllegalArgumentException
Get value of the specified field.

Parameters:
fieldId - field ID
Returns:
field value
Throws:
IllegalArgumentException - if field with specified ID does not exist or was not populated

setFieldValue

public void setFieldValue(FieldId fieldId,
                          MdmValue value)
                   throws IllegalArgumentException,
                          MdmValueTypeException
Set new value to the specified field.

Parameters:
fieldId - field ID
value - new field value
Throws:
IllegalArgumentException - if field with specified ID does not exist
MdmValueTypeException - if there is mismatch between field type and type of value

getMultiregionFieldValue

public MultiregionValue getMultiregionFieldValue(FieldId fieldId)
                                          throws IllegalArgumentException
Get multi-region value of the specified field.

Parameters:
fieldId - field ID
Returns:
field multi-region value
Throws:
IllegalArgumentException - if field with specified ID does not exist or was not populated

getDefaultRegionCode

public String getDefaultRegionCode()
Returns the default region code.

Returns:
the default region code.

findLookupRecords

public Record[] findLookupRecords(FieldId lookupFieldId)
                           throws IllegalArgumentException
Find supported lookup record (or records for multi-value case) in cache of result set for the specified lookup field.

Parameters:
lookupFieldId - ID of lookup field
Returns:
array of supported lookup record. If there is not values for specified lookup field then empty array is returned. If supported lookup record was not loaded then Null is returned.
Throws:
IllegalArgumentException - if field with specified ID does not exist or was not populated or is not lookup field

getLookupDisplayValue

public String getLookupDisplayValue(FieldId lookupFieldId)
                             throws IllegalArgumentException
Returns display value for lookup field

Parameters:
lookupFieldId - ID of lookup field
Returns:
display value of lookup record. If lookup record was not loaded then Null is returned
Throws:
IllegalArgumentException - if field with specified ID does not exist or was not populated or is not lookup field

getTupleDisplayValue

public String getTupleDisplayValue(FieldId tupleFieldId)
                            throws IllegalArgumentException
Returns the display value for the tuple field.

Parameters:
tupleFieldId - a tuple field
Returns:
a display value
Throws:
IllegalArgumentException
Since:
7.1

isTaxonomyField

public boolean isTaxonomyField(FieldId fieldId)
Indicates if the specified record field is taxonomy field

Parameters:
fieldId - field ID
Returns:
true if specified field is taxonomy field, false otherwise

isQualifiedField

public boolean isQualifiedField(FieldId fieldId)
Indicates if specified field is qualified lookup field

Parameters:
fieldId - field ID
Returns:
true if specified field is qualified lookup field, false otherwise

containsField

public boolean containsField(FieldId fieldId)
Check if specified field is populate with data

Parameters:
fieldId - field ID
Returns:
true if specified field is populated with data, false otherwise

getAttributes

public AttributeId[] getAttributes(FieldId taxonomyFieldId)
                            throws IllegalArgumentException
Get array of attribute IDs for the specified taxonomy field.

Parameters:
taxonomyFieldId - taxonomy field ID
Returns:
array of attribute IDs. If attributes were not populated then empty array is returned
Throws:
IllegalArgumentException - if field was not populated or field is not taxonomy field

getAttributeValue

public MdmValue getAttributeValue(FieldId taxonomyFieldId,
                                  AttributeId attrId)
                           throws IllegalArgumentException
Get value of the specified attribute for taxonomy field.

Parameters:
taxonomyFieldId - taxonomy field ID
attrId - attribute ID
Returns:
attribute value
Throws:
IllegalArgumentException - if field or attribute with specified ID was not populated or field is not taxonomy field

setAttributeValue

public void setAttributeValue(FieldId taxonomyFieldId,
                              AttributeId attrId,
                              MdmValue value)
                       throws IllegalArgumentException,
                              MdmValueTypeException
Set new value to the specified attribute for taxonomy field.

Parameters:
taxonomyFieldId - taxonomy field ID
attrId - attribute ID
value - new attribute value
Throws:
IllegalArgumentException - if field or attribute with specified ID was not populated or field is not taxonomy field
MdmValueTypeException - if there is mismatch between attribute type and type of value

containsAttribute

public boolean containsAttribute(FieldId taxonomyFieldId,
                                 AttributeId attrId)
Check if specified attribute is populate with data

Parameters:
taxonomyFieldId - field ID
attrId - attribute ID
Returns:
true if specified field is populated with data, false otherwise

clone

public Object clone()
Returns a clone.

Returns:
a clone

getReverseLookups

public ReverseLookupId[] getReverseLookups()
Returns the reverse lookups specified for the record.

Returns:
An array of reverse lookup IDs
Since:
7.1 SP 08

getReverseLookupRecords

public Record[] getReverseLookupRecords(ReverseLookupId reverseLookup)
Gets the value of the specified reverse lookup field, which is an array of records that reference this record.

Parameters:
reverseLookup - Reverse lookup field to retrieve
Returns:
An array of records that reference this record.
Since:
7.1 SP 08

hasFieldValue

public boolean hasFieldValue(FieldId fieldId)
Returns whether the specified field has field value, meaning not null. This method is intended for use with tuple fields since getFieldValue(FieldId).isNull() always return true when ResultDefinition.setIsLoadTupleValues(boolean) is set to false. In such a case, this method can be used to determine if tuple values exist.

For non-tuple fields, the following statement is true:

getFieldValue(FieldId).isNull() != hasFieldValue(FieldId)

Parameters:
fieldId - field ID
Returns:
Returns true if the field has field value, otherwise false.
Since:
7.1 SP8

toString

public String toString(FieldId fieldId)
Converts specified field value to string; this is the short form of the method.

Parameters:
fieldId - the field ID
Returns:
The field value as string
Since:
7.1 SP9
See Also:
getFieldValue(FieldId)

toString

public String toString(FieldId fieldId,
                       int regionInheritanceMode,
                       RegionInheritanceProperties regionInheritance,
                       DimensionsManager dm)
Converts the specified field value to a string according to the specified parameters; this is the long form of the method.

Parameters:
fieldId - the field ID
regionInheritanceMode - specifies the value inheritance mode, defined by the RegionalLayer enumeration; relevant for multilingual fields
regionInheritance - specifies the inheritance for a language; relevant for multilingual fields, otherwise can be null
dm - specifies the dimension manager for unit of measurement (UOM); relevant for user-defined UOM fields, otherwise can be null
Returns:
The field value as string
Since:
7.1 SP9
See Also:
getFieldValue(FieldId), RegionalLayer, GetRepositoryInheritedRegionListCommand, GetRepositoryDimensionsCommand

toString

public String toString(FieldId fieldId,
                       AttributeId attributeId)
Converts the specified attribute value to string; this is the short form of the method.

Parameters:
fieldId - the ID of the taxonomy lookup field , related to the attribute
attributeId - the attribute ID
Returns:
The attribute value as string
Since:
7.1 SP9
See Also:
getAttributeValue(FieldId, AttributeId)

toString

public String toString(FieldId fieldId,
                       AttributeId attributeId,
                       int regionInheritanceMode,
                       RegionInheritanceProperties regionInheritance,
                       DimensionsManager dm)
Converts the specified attribute value to string according to the specified parameters; this is the long form of the method.

Parameters:
fieldId - the ID of the taxonomy lookup field , related to the attribute
attributeId - the attribute ID
regionInheritanceMode - specifies the value inheritance mode, defined by the RegionalLayer enumeration; relevant for multilingual text attributes
regionInheritance - specifies the inheritance for a language; relevant for multilingual text attributes, otherwise can be null
dm - specifies the dimension manager for unit of measurement (UOM); relevant for user-defined UOM numeric attributes, otherwise can be null
Returns:
The attribute value as string
Since:
7.1 SP9
See Also:
getAttributeValue(FieldId, AttributeId), RegionalLayer, GetRepositoryInheritedRegionListCommand, GetRepositoryDimensionsCommand


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.