com.sap.mdm.data
Class RelationshipFactory

java.lang.Object
  extended bycom.sap.mdm.data.RelationshipFactory

public class RelationshipFactory
extends Object

The RelationshipFactory is factory class responsible for creation of a new instances of Relationship and RelationshipGroup instances on the client side. These instances can be used for creation and updating record relationships.

See Also:
RetrieveRelationshipsCommand, ModifyRelationshipsCommand

Method Summary
static Relationship createRelationship(int relationshipType, RecordId anchorRecordId, RecordId memberRecordId, boolean hasQuantity, int quantity, boolean hasRequired, boolean isRequired)
          Creates a new relationship of the specified type between anchor and member records
static Relationship createRelationship(Relationship otherRelationship)
          Creates a clone of existing relationship.
static RelationshipGroup createRelationshipGroup(RelationshipGroup otherGroup)
          Creates a new relationship group as a clone of existing relationship group
static RelationshipGroup createRelationshipGroup(RelationshipProperties relationship, int relationshipType, RecordId anchorRecordId)
          Creates a new empty relationship group of the specified type and related to the specified anchor record.
static RelationshipGroup createRelationshipGroup(RelationshipProperties relationship, int relationshipType, RecordId anchorRecordId, Relationship[] members)
          Creates a new relationship group of the specified type, related to the specified anchor record and including set of relationship members.
static RelationshipGroup createRelationshipGroupForUpdate(RelationshipGroup otherGroup)
          Creates a clone of existing relationship group
static RelationshipGroup createRelationshipGroupForUpdate(RelationshipProperties relationship, int relationshipType, RecordId anchorRecordId, Relationship[] members)
          Creates an instance of existing relationship group of the specified type, related to the specified anchor record and including set of relationship members.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createRelationshipGroup

public static RelationshipGroup createRelationshipGroup(RelationshipProperties relationship,
                                                        int relationshipType,
                                                        RecordId anchorRecordId)
Creates a new empty relationship group of the specified type and related to the specified anchor record.

Parameters:
relationship - the relationship definition
relationshipType - the type of relationship (CHILD, PARENT or SIBLING)
anchorRecordId - the ID of anchor record
Returns:
instance of RelationshipGroup
See Also:
including constants for relationship type

createRelationshipGroup

public static RelationshipGroup createRelationshipGroup(RelationshipProperties relationship,
                                                        int relationshipType,
                                                        RecordId anchorRecordId,
                                                        Relationship[] members)
Creates a new relationship group of the specified type, related to the specified anchor record and including set of relationship members.

Parameters:
relationship - the relationship definition
relationshipType - the type of relationship (CHILD, PARENT or SIBLING)
anchorRecordId - the ID of anchor record
members - the relationship members
Returns:
instance of RelationshipGroup
See Also:
including constants for relationship type

createRelationshipGroupForUpdate

public static RelationshipGroup createRelationshipGroupForUpdate(RelationshipProperties relationship,
                                                                 int relationshipType,
                                                                 RecordId anchorRecordId,
                                                                 Relationship[] members)
Creates an instance of existing relationship group of the specified type, related to the specified anchor record and including set of relationship members. This instance can be used for update: remove/add relationships, change parameters of members.

Parameters:
relationship - the relationship definition
relationshipType - the type of relationship (CHILD, PARENT or SIBLING)
anchorRecordId - the ID of anchor record
members - the relationship members
Returns:
instance of RelationshipGroup
See Also:
including constants for relationship type

createRelationshipGroup

public static RelationshipGroup createRelationshipGroup(RelationshipGroup otherGroup)
Creates a new relationship group as a clone of existing relationship group

Parameters:
otherGroup - the existing relationship group
Returns:
instance of RelationshipGroup

createRelationshipGroupForUpdate

public static RelationshipGroup createRelationshipGroupForUpdate(RelationshipGroup otherGroup)
Creates a clone of existing relationship group

Parameters:
otherGroup - the existing relationship group
Returns:
instance of RelationshipGroup

createRelationship

public static Relationship createRelationship(int relationshipType,
                                              RecordId anchorRecordId,
                                              RecordId memberRecordId,
                                              boolean hasQuantity,
                                              int quantity,
                                              boolean hasRequired,
                                              boolean isRequired)
Creates a new relationship of the specified type between anchor and member records

Parameters:
relationshipType - the relationship type (CHILD, PARENT or SIBLING)
anchorRecordId - the anchor record Id
memberRecordId - the member record Id
hasQuantity - whether it has a quantity
quantity - the quantity value
hasRequired - whether it has the required
isRequired - the required value
Returns:
instance of Relationship
See Also:
including constants for relationship type

createRelationship

public static Relationship createRelationship(Relationship otherRelationship)
Creates a clone of existing relationship.

Parameters:
otherRelationship - the existing relationship
Returns:
instance of Relationship


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.