com.sap.mdm.data.commands
Class RetrieveRelationshipsCommand

java.lang.Object
  extended bycom.sap.mdm.commands.AbstractCommandBase
      extended bycom.sap.mdm.commands.AbstractCommand
          extended bycom.sap.mdm.session.AbstractSessionCommand
              extended bycom.sap.mdm.session.AbstractUserSessionCommand
                  extended bycom.sap.mdm.data.commands.RetrieveRelationshipsCommand
All Implemented Interfaces:
Command, PassportSupport
Direct Known Subclasses:
RetrieveRelationshipsExCommand

public class RetrieveRelationshipsCommand
extends AbstractUserSessionCommand

This command allows for retrieving relationships related to the specified anchor record. If member records are loaded then they can be sorted according to sort definition that is specified in the member result definition. The sorting is applicable only if relationship property 'HasPosition' is false, otherwise the sort definition ignored.

See Also:
ModifyRelationshipsCommand

Constructor Summary
RetrieveRelationshipsCommand(ConnectionAccessor connection)
          Constructor.
RetrieveRelationshipsCommand(UserSessionContext ctx)
          Creates a new instance of this command by context.
 
Method Summary
 Record getAnchorRecord()
          Returns the anchor record.
 RecordId getAnchorRecordId()
          Returns the ID of anchor record.
 ResultDefinition getAnchorResultDefinition()
          Returns the result definition for anchor record.
 ResultDefinition[] getAnchorSupportingResultDefinitions()
          Returns the list of result definitions for anchor record.
 ResultDefinition getMemberResultDefinition()
          Returns the result definition for member records.
 ResultDefinition[] getMemberSupportingResultDefinitions()
          Returns the list of result definitions for member records.
 RelationshipGroup getRelationshipGroup()
          Returns relationship group as the result of the command.
 RelationshipId getRelationshipId()
          Returns the relationship ID.
 boolean isGetChildren()
          Indicates whether only child relationships are retrieved.
 boolean isLoadRecords()
          Specifies if relationship records should be also loaded from the repository together with record IDs.
 void setAnchorRecord(Record anchorRecord)
          Sets the anchor record (required*).
 void setAnchorRecordId(RecordId anchorRecordId)
          Sets ID of the anchor record (required*).
 void setAnchorResultDefinition(ResultDefinition anchorResultDefinition)
          Sets the result definition for anchor record (optional).
 void setAnchorSupportingResultDefinitions(ResultDefinition[] anchorSupportingResultDefinitions)
          Sets the list of result definitions for anchor record (optional).
 void setGetChildren(boolean getChildren)
          Specify if only child relationships are retrieved (optional).
 void setLoadRecords(boolean loadRecords)
          Specifies if relationship records should be also loaded from the repository together with record IDs (optional).
 void setMemberResultDefinition(ResultDefinition memberResultDefinition)
          Sets the result definition for member records (optional).
 void setMemberSupportingResultDefinitions(ResultDefinition[] memberSupportingResultDefinitions)
          Sets the list of result definitions for member records (optional).
 void setRelationshipId(RelationshipId relationshipId)
          Sets the relationship ID (required).
 
Methods inherited from class com.sap.mdm.commands.AbstractCommand
getSession, setSession
 
Methods inherited from class com.sap.mdm.commands.AbstractCommandBase
execute, getPassport, isCommandComplete, setPassport
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetrieveRelationshipsCommand

public RetrieveRelationshipsCommand(ConnectionAccessor connection)
Constructor.

Parameters:
connection - the connection to the MDM server

RetrieveRelationshipsCommand

public RetrieveRelationshipsCommand(UserSessionContext ctx)
                             throws ConnectionException,
                                    SessionException
Creates a new instance of this command by context.

Parameters:
ctx - the user session context.
Method Detail

getRelationshipId

public RelationshipId getRelationshipId()
Returns the relationship ID.

Returns:
the relationship ID

setRelationshipId

public void setRelationshipId(RelationshipId relationshipId)
Sets the relationship ID (required).

Parameters:
relationshipId - the relationship ID

getAnchorRecordId

public RecordId getAnchorRecordId()
Returns the ID of anchor record.

Returns:
the anchor record ID

setAnchorRecordId

public void setAnchorRecordId(RecordId anchorRecordId)
Sets ID of the anchor record (required*).

Parameters:
anchorRecordId - the anchor record ID

getAnchorRecord

public Record getAnchorRecord()
Returns the anchor record.

Returns:
the anchor record

setAnchorRecord

public void setAnchorRecord(Record anchorRecord)
Sets the anchor record (required*).

Parameters:
anchorRecord - the anchor record

isGetChildren

public boolean isGetChildren()
Indicates whether only child relationships are retrieved. This parameter is relevant only for 'parent/child' relationship, it is ignored for 'sibling' relationship

Returns:
true if children are returned, false if parents are returned

setGetChildren

public void setGetChildren(boolean getChildren)
Specify if only child relationships are retrieved (optional). The default is true. This parameter is relevant only for 'parent/child' relationship, it is ignored for 'sibling' relationship

Parameters:
getChildren - true if children should be returned, false if parents should be returned

isLoadRecords

public boolean isLoadRecords()
Specifies if relationship records should be also loaded from the repository together with record IDs.

Returns:
true if record are retrieved, false otherwise

setLoadRecords

public void setLoadRecords(boolean loadRecords)
Specifies if relationship records should be also loaded from the repository together with record IDs (optional). The default is false.

Parameters:
loadRecords -

getMemberResultDefinition

public ResultDefinition getMemberResultDefinition()
Returns the result definition for member records. The result definition specifies the list of field/columns to retrieve the data for.

Returns:
the result definition
See Also:
AbstractRetrieveLimitedRecordsCommand.getSupportingResultDefinitions()

setMemberResultDefinition

public void setMemberResultDefinition(ResultDefinition memberResultDefinition)
Sets the result definition for member records (optional). The result definition specifies the list of field/columns to retrieve the data for.

Parameters:
memberResultDefinition - the result definition
See Also:
AbstractRetrieveLimitedRecordsCommand.setSupportingResultDefinitions(ResultDefinition[])

getAnchorResultDefinition

public ResultDefinition getAnchorResultDefinition()
Returns the result definition for anchor record. The result definition specifies the list of field/columns to retrieve the data for.

Returns:
the result definition
See Also:
AbstractRetrieveLimitedRecordsCommand.getSupportingResultDefinitions()

setAnchorResultDefinition

public void setAnchorResultDefinition(ResultDefinition anchorResultDefinition)
Sets the result definition for anchor record (optional). The result definition specifies the list of field/columns to retrieve the data for.

Parameters:
anchorResultDefinition - the result definition
See Also:
AbstractRetrieveLimitedRecordsCommand.setSupportingResultDefinitions(ResultDefinition[])

getMemberSupportingResultDefinitions

public ResultDefinition[] getMemberSupportingResultDefinitions()
Returns the list of result definitions for member records. These result definitions specify the list of fields/columns to retrieve for supporting lookup fields from the main result definition.

Returns:
the list of result definitions
See Also:
AbstractRetrieveLimitedRecordsCommand.getResultDefinition()

setMemberSupportingResultDefinitions

public void setMemberSupportingResultDefinitions(ResultDefinition[] memberSupportingResultDefinitions)
Sets the list of result definitions for member records (optional). These result definitions specify the list of fields/columns to retrieve for supporting lookup fields from the main result definition.

Parameters:
memberSupportingResultDefinitions - the list of result definitions

getAnchorSupportingResultDefinitions

public ResultDefinition[] getAnchorSupportingResultDefinitions()
Returns the list of result definitions for anchor record. These result definitions specify the list of fields/columns to retrieve for supporting lookup fields from the main result definition.

Returns:
the list of result definitions
See Also:
AbstractRetrieveLimitedRecordsCommand.getResultDefinition()

setAnchorSupportingResultDefinitions

public void setAnchorSupportingResultDefinitions(ResultDefinition[] anchorSupportingResultDefinitions)
Sets the list of result definitions for anchor record (optional). These result definitions specify the list of fields/columns to retrieve for supporting lookup fields from the main result definition.

Parameters:
anchorSupportingResultDefinitions - the list of result definitions

getRelationshipGroup

public RelationshipGroup getRelationshipGroup()
Returns relationship group as the result of the command.

Returns:
instance of RelationshipGroup


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.