This page last changed on Sep 10, 2007 by salexand.

original .. from Manage Entity Data Service Keys

Original

Data service keys are used in conjunction with create-update-delete operations. Techniques for creating and managing a key depend on the nature and state of your data service.

Methods of Creating Entity Data Service Keys
Schema Key Creation Method
Details
Imported  When a physical data service is created from a relational source metadata keys, if any, are imported with other metadata.
Manually
You can create a key for any entity data service that contain a Read function. The key is created by selecting data service elements. 
Automatically
In some situations a key can be inferred from the components of a logical data service.

There are several things to keep in mind related to the creation and management of data service keys including:

  • Only one key can be associated with an entity data service containing a valid read function.
  • Keys are represented in your dataspace project as schema (XSD) file:

    dataserviceName-KEY.xsd

  • Each time a project is built its dataspace key schemas are validated.
  • The proper definition of a key requires specific knowledge of your data as well as a good understanding of the update map being planned for the functions in the data service.

Accessing Key Management Routines

To access the key management functionality of your data service:

  1. Open your data service in Eclipse
  2. Right-click in the work area or on the title line of the data service
  3. Select Manage Keys...

Inspecting a Data Service Key

Once you have accessed the Select Manage keys option if the right-click menu option Delete Key is available, it means that a key is currently associated with your data service.

You can inspect an existing key by:

  1. Opening the key schema file.
  2. Inspecting a Key Schema


  1. Double-clicking on the key element.
  2. Elements in a Key Element


Associating a Key Schema with a Data Service

You can associate a key schema with your data service:

  • By generating a new schema.
  • By selecting an existing schema type.

Associating a Schema as a Data Service Key

Generally speaking, a key should be defined in such a way that it provides sufficient uniqueness to allow an update operation to identify the exact target tuple.

This page support two options:

  • Generating a new key schema.
  • Associating an existing key schema with the current data service. 

Generating a New Key Schema

Generate a New Schema Dialog Options
Option Action
Comment/Reference
Generate a new schema Select
Select this option if you want to create a new key schema using the wizard.
Directory: select a directory
Select any directory in your dataspace project.
File Name:
name of key schema
Recommended name is in the form:

dataserviceName-KEY.xsd

Global Element: read only
Displays the name of the global element in the generated key schema. The global element name is determined by the wizard and typically matches the name of the associated data service.

Next
Proceed to selecting elements for the key.

Associating an existing key schema with the current data service

There are several situations where you might want to select an existing key schema for a data service:

  • The schema is created externally.
  • The schema was previously created but is not currently associated with the data service.

To select an existing key schema:

Choose the select an existing schema type option

Browse to the location of your schema 

Choose a key schema from inside your project. Key schema are identified with a _KEY appended to the name of the data service such as:

CUSTOMER_KEY.xsd

Select a global element if the schema contains more than one.

Generate a New Schema Dialog Option
Option Action
Comment/Reference
Select an existing schema type Select
Select this option if you have an existing key schema that you want to associate with your data service.
File Name:
Browse and select
Select a valid key schema in your dataspace. Key schema are often identified with a _KEY appended to the name of the data service.
Select Global Element:
Select global element
If the identify key schema has more than one global elements, select.
Selector: n/a
Displays the selector element in the key schema.
  Finish
Completes association

Specifying Key Fields

You can specify key fields in two ways:

  • By auto-generating the key using the primary read function in the logical data service.
  • Manually by selecting the fields that make up the key

Auto-generating the schema key

TBD

Specifying Key Fields Manually

Select the fields that constitute a valid update key for your data service. 

Specifying Key Fields

Document generated by Confluence on Jan 13, 2009 15:57