Entity
An Entity object is a business object, such as Customer or Product, in line-of-business (LOB) application. In the Business Data Catalog, an Entity object belongs to a single LOB system. As with all the metadata objects, it derives from the MetadataObject base class and must have a unique name.
Entities contain identifiers, methods, and actions. Entities can also have other related entities associated with them. For example, Customers and Order entities in the AdventureWorks 2000 system have an association because they share a relationship: customers make orders. This relationship is implemented as an association in the metadata.
The business objects, for example, customer #88697 and order #1000 in the LOB application, are referred to as entity instances. If your entity maps to a table, you can think of the entity instance as a row.
Client Impact
After you define an entity, you can pick the entity from the Entity Picker, display entity instances in the Business Data Web Parts and lists, and search using Enterprise Search. You must also define the following for entities: identifiers and Finder and SpecificFinder method instances. You may additionally define instance and static GenericInvokers and ViewAccessors.
Identifiers An identifier enables the Business Data Catalog to uniquely identify an entity instance. If you define an entity without an identifier, then that entity cannot have actions on it, cannot be searched or indexed, and cannot be used in any of the Business Data features except the List and Related List Web Part. However, it is sometimes still useful to define an Entity without Identifiers - if all you want to do is display a list of some or all of them (a good example is 'CostCenters')
Finder and SpecificFinder methods Finder methods enable you to use your entity in a Business Data List Web Part. If you do not define Finder methods, your entity cannot be used in these Web Parts. SpecificFinder methods enable additional functionality such as the ability to have actions, to be searched and indexed, and to be used in Business Data features. If you do not define SpecificFinder methods for an entity, it cannot have actions on it, cannot be searched or indexed, and cannot be used in any of the Business Data features except the Related List Web Part.
GenericInvokers. Generic invokers allow you to execute arbitrary logic in a back end system. However, the client must supply the full complex arguments for the invocation.
ViewAccessors. Every instance of an entity is said to be a particular 'view' of the Entity. A View is defined by the set of fields on the EntityInstance. All Views share the identifier fields. ViewAccessors allow changing the current view of the EntityInstance to another view.
Example
The AdventureWorks sample defines the following three entities:
Product
SalesOrder
Customer
The sample defines the Product entity as follows.
<Entities>
<Entity EstimatedInstanceCount="10000" Name="Product">
<Properties>
<Property Name="Title" Type="System.String">Name</Property>
</Properties>
….
….
</Entity>
<Entity ….
</Entity>
</Entities>
Schema
Child | Type | Occurs | Default | Limits / Accepted Values | Description |
---|---|---|---|---|---|
EstimatedInstanceCount |
Attribute (bdc:InstanceCount) |
0..1 |
10000 |
Min.: 0 |
Estimated number of instances of this entity. Business Data Catalog clients can alter how they display lists of instances based on EstimatedInstanceCount. |
Identifiers |
Element |
1..1 |
Min. identifiers per entity: 0 Max. identifiers per entity: 20 |
Container element for Identifier. |
|
Methods |
Element |
Max. methods per entity: 50 |
Container element for Method. |
||
Actions |
Element |
No max. actions per entity enforced |
Container Element for Action. |
Properties
Following are the properties that the Entity object accepts for both database and Web service systems.
Important
Properties are case-sensitive.
Property | Type | Required | Default Value | Limits/Accepted Values | Comments |
---|---|---|---|---|---|
Title |
System.String |
No |
None |
Name of the T:Microsoft.Office.Server.ApplicationRegistry.MetadataModel.TypeDescriptor instance that represents the display value (title) of an Entity object. This value is the default title of business data search results and the default display value in the business data column. |
|
__BdcTitle |
System.String |
No |
None |
This is deprecated. |
|
__BdcLastModifiedTimestamp |
System.String |
No |
None |
Name of the TypeDescriptor instance in the return value of the IDEnumerator method that represents the last modified date of an instance. Use this property to enable incremental search crawls. |
|
Audit |
System.Boolean |
No |
true |
true false |
If true, an entry is written to the Shared Resource Provider's audit log each time one of this entity’s methods is executed. |
DefaultAction |
Name of the Action that is used as the hyperlink in business data search results, business data columns, and elsewhere. This is an auto created property. |
See Also
Tasks
AdventureWorks SQL Server 2000 Sample
How to: Get Started with Using the Runtime Object Model
How to: Get Started with Using the Administration Object Model