Association Class
Represents a relationship between two or more related entities.
Inheritance Hierarchy
System.Object
Microsoft.Office.Server.ApplicationRegistry.Administration.MetadataObject
Microsoft.Office.Server.ApplicationRegistry.Administration.AccessControlledMetadataObject
Microsoft.Office.Server.ApplicationRegistry.Administration.IndividuallySecurableMetadataObject
Microsoft.Office.Server.ApplicationRegistry.Administration.MethodInstance
Microsoft.Office.Server.ApplicationRegistry.Administration.Association
Namespace: Microsoft.Office.Server.ApplicationRegistry.Administration
Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)
Syntax
'Declaration
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
Public Class Association _
Inherits MethodInstance
'Usage
Dim instance As Association
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
public class Association : MethodInstance
Remarks
An Association object links related entities within a system. For example, a customer is associated with a salesorder in the AdventureWorks system: a customer makes sales orders. An Association metadata object holds pointers to the parent and child entities as well as a pointer to the business logic (a Method object) that allows a client to get the child entity instances from the parent entity instance. The traversal of an association is merely a method call on the LOB system, with a few special properties (a slot in the input for the identifier values of the source entity instance, and a slot in the output for the identifier values of the destination entity instances)
The SourceEntity and DestinationEntity objects are not separate metadata objects. They are just instances of the Entity metadata object. Both SourceEntity and DestinationEntity objects should exist in the same LobSystem object
The association logic (Method) can be on any entity, either source, destination, or an unrelated entity. However, the order in which you define the source and destination entities is very important. This is because the XML file is processed from top to bottom. Therefore, you should ensure the entities referenced in the association method are defined before the entity containing the association method. If they are not in the right order, you receive an error when you try to add the application definition to the Business Data Catalog because the association method contains references to entities that are not yet created.
The Business Data Catalog supports multiple SourceEntity and one DestinationEntity object scenario. For a sample, see SampleWebService.
The Business Data Catalog also supports Foreign Key pseudo-associations. Foreign Key pseudo-associations are not first-class associations. Consider a Web method that returns Customers, and one of the fields of a Customer is the Key to the Address of the Customer. A metadata modeler may reuse this method as a Customer->Address Association method. Foreign Key pseudo-associations see that the target of this method is an Address, fetch the Key of the Address from the returned Customer, and then call the Specific Finder of the target Entity to return the Address automatically.
Note
The Business Data Catalog does not support cyclic chaining of entities via associations. That is, it does not support Entity A is related to Entity B is related to Entity C is related to Entity A.
Schema
Child |
Type |
Occurs |
Default |
Limits / Accepted Values |
Description |
---|---|---|---|---|---|
AssociationMethodEntityName |
Attribute (String) |
1..1 |
The name of the Entity containing the Method that is invoked to traverse the association. This serves to disambiguate the AssociationMethodName attribute below, which may refer to similarly named Methods on either the source or the destination Entity in the Association. |
||
AssociationMethodName |
Attribute (String) |
1..1 |
The name of the Method that traverses the Association. |
||
AssociationMethodReturnParameterName |
Attribute (String) |
1..1 |
The name of the return parameter that contains the destination entity instances. Since an Association is a subclassed MethodInstance, this works the same way as it would for MethodInstances. |
||
SourceEntity |
Element |
1..many |
Represents a source entity in the associations. Associations may have multiple source entities. For example, in SAP a Customer and Sales Area are needed to get a list of Sales Orders. |
||
DestinationEntity |
Element |
1..1 |
Represents the destination entity in the associations. |
SourceEntity
Children
Child |
Type |
Occurs |
Default |
Limits / Accepted Values |
Description |
---|---|---|---|---|---|
Name |
Attribute (String) |
1..1 |
The name of a source entity in the association |
DestinationEntity
Children
Child |
Type |
Occurs |
Default |
Limits / Accepted Values |
Description |
---|---|---|---|---|---|
Name |
Attribute (String) |
1..1 |
The name of a destination entity in the association. |
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Office.Server.ApplicationRegistry.Administration Namespace