Mapping a Metadata Model to a Grid Object

You can map (link) a table in a metadata model to a Data Federation object, such as a data service or a database operation, or to a table in a database. You can use mapping for both schema validation and aliasing.

When you create a mapping, you validate the mapped object’s schema against the schema of the table in the metadata model. When you deploy the metadata model, this mapping allows you to access the object using the table name in the model—probably the same name you use to access the table in the database.

  1. In Enterprise Explorer, navigate to the object you want to map. In this example, we map a database operation called GetEmpGivenName to a metadata model table called EMP.
  2. Click the object you want to map (here, GetEmpGivenName) in Enterprise Explorer, then drag and drop it on the EMP table in the editor pane. The metadata model editor checks to ensure that the schema of the object being dropped matches that of the table. If so, the mapping is made and the mapped object appears in the editor pane. A mapped table looks like this:


    If you’re performing the mapping for validation, you can stop here.

    If the schemas do not match—for example, if the grid object and the table in the model don’t have the same number of columns, or if one or more column data types are different—the mapping is invalid and Data Federation returns an error.

  3. Click OK. The mapping shows as not valid and displays a red state.
  4. Resolve any schema errors that exist.
You have created an alias for the mapped object (in this case, the database operation GetEmpGivenName); you can now access it via JDBC using the name of the table in the metadata model. If the table is named for one in an external database, you can point your application at either the database or Data Federation; no further changes are required.
Next 

Deploy the model.

Related concepts
Metadata Models
Related tasks
Importing a Metadata Model
Creating a Metadata Model
Editing a Metadata Model
Deriving a View Model from a Metadata Model
Deleting a Metadata Model
Deploying a Metadata Model

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com