Updating maps with the Mapping editor
You can use the Mapping editor to configure the existing mappings between your enterprise beans and database elements such as tables and views. The map information is stored in the map.mapxmi file, and the Mapping editor is the default editor for this file.
For more information about the editor, see Mapping editor. For information about creating your initial mappings that you can work with in the editor, see the topics: Generating a top-down mapping, Generate a bottom-up mapping1, or Generating a meet-in-the-middle mapping.
To open an existing mapping configuration (map.mapxmi file), do one of the following:
- In the Project Explorer view, right-click the Deployment Descriptor in the EJB project, and select Open With > Mapping Editor, then select the database backend.
- In the Project Explorer, expand ejbModule > META-INF > backend > [backend folder], then double-click map.mapxmi.
Creating EJB mappings
After you create an initial map, you can use the Mapping Editor to map a bean element to a table element.Specifying a discriminator column and value
You can specify a discriminator column using the Mapping Editor.Creating inheritance maps
Use the Mapping editor to create inheritance mappings.Creating many-to-many (M:M) relationship maps
Use the Mapping editor to create a many-to-many relationship map.Specifying optimistic concurrency control scheme for EJB 2.x CMP entity beans
Concurrency control is the management of contention for data resources. A concurrency control scheme is considered optimistic when locks are acquired and released over a short period of time at the end of transaction. The objective of optimistic concurrency control is to minimize the time over which a given resource would be unavailable for use by other transactions.Avoiding overlapping maps
In some cases, the mapping tool allows you to map a column in the database twice, once as an attribute and once in a relationship role. This can be referred to as an overlap in the mapping. This overlap could cause data integrity problems. For this reason, you should avoid overlapping your mappings to database elements.Removing mappings via the Mapping editor
Use the Mapping editor to remove existing mappings.Deleting maps and schemas
You can delete schemas and their associated maps, or just a map, from the J2EE perspective.Creating secondary table maps
Use the Mapping editor to map a bean to more than one table.Creating and mapping unmapped elements
If you make changes to an EJB module by adding or changing enterprise beans, you may need to update the top-down mappings from beans to database. Or, if you have made changes to the backend or have imported database changes, you may also need to update the bottom-up mapping.Mapping database views
The Mapping editor supports mapping enterprise beans and database views.1 Bottom-up mapping is not available