Partager via


Association, classe (Microsoft.Office.Server.ApplicationRegistry.MetadataModel)

Represents a relationship between two or more related entities within a line-of-business (LOB) system.

Espace de noms : Microsoft.Office.Server.ApplicationRegistry.MetadataModel
Assembly : Microsoft.SharePoint.Portal (dans microsoft.sharepoint.portal.dll)

Syntaxe

'Déclaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class Association
    Inherits MethodInstance
'Utilisation
Dim instance As Association
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
public class Association : MethodInstance

Remarques

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.

Notes

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.

Exemple

For example, a customer is associated with a salesorder in the AdventureWorks system: a customer makes sales orders. An association holds pointers to the parent and child entities, as well as a pointer to the business logic that allows a client to get the child entity from the parent entity. The traversal of an association is merely a method call on the LOB system.

Hiérarchie d'héritage

System.Object
   Microsoft.Office.Server.ApplicationRegistry.MetadataModel.MetadataObject
     Microsoft.Office.Server.ApplicationRegistry.MetadataModel.AccessControlledMetadataObject
       Microsoft.Office.Server.ApplicationRegistry.MetadataModel.MethodInstance
        Microsoft.Office.Server.ApplicationRegistry.MetadataModel.Association

Sécurité des threads

Les membres statiques publics de ce type (Shared en Visual Basic) sont sécurisés au niveau des threads. Il n'est pas garanti que les membres d'instance soient sécurisés au niveau des threads.

Voir aussi

Référence

Membres Association
Microsoft.Office.Server.ApplicationRegistry.MetadataModel, espace de noms