ObjectExtender User's Guide and Reference

Defining a data store map

To do this step, you need a model and a schema.

In brief, use the Map Browser to define a data store map. A data store map logically connects the object model description with the data store schema description. This is used for code generation to determine the proper SQL and supporting code needed for persisting the model objects. Using the Map Browser you create table maps for your business objects. All of the table maps collectively comprise your data store map.

Creating a table map consists of mapping the model attributes and relationships to the schema. For each model attribute, you specify the column which should be read to populate the attribute. For each relationship, you specify the foreign key relationship which is its persistent representation.

When all of the table maps are defined, the persistence support for your data store can then be created using code generation services.

Creating maps. To create a new data store map:

  1. Launch the Map Browser.
  2. From the Datastore_Maps menu, select New Datastore Map.
  3. Provide a data store map name.
  4. Select the names of the model and schema that you are going to map.
  5. Click OK.

Creating table maps. A class must have at least one table map. The table map specifies the database table to which the class will be mapped. Table maps contain property and relationship maps which refer to columns and keys respectively. To create a table map:

  1. From the Table_Maps menu, select a table map. There are several kinds of table maps.
  2. Select the name of the database table you are mapping.
  3. Click OK.

Creating property maps. Create property maps for each table map. To create a property map:

  1. From the Table Maps view, select the table map.
  2. From the Table_Maps menu, select Edit Property Maps. This launches the Property Map Editor.
  3. Mapping attributes. In the Attributes tabbed dialog box, map the class attributes to table columns by selecting the attribute, the type of map, and the table column.
  4. Mapping relationships. In the Association Roles tabbed dialog box, map the class associations to foreign key relationships.
  5. Click OK.

Generating services. When you have completed all of the table maps, generate the data services using the code generation services.

What the code generation services create. The code generation services will create the following code:

Saving data store maps. Save your data store map to an application and storage class that you supply. Saving your map enables you to take advantage of the existing library management functions. These functions are the same ones you use when sharing code with other developers such as versioning, releasing, and loading different editions of an application.

Suggestion: A useful naming convention is to name your application as follows: XYZMetadataApp where the XYZ is some prefix you choose. Use this application to store a model, schema, and map for a given application.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]