4.8. Visualize Mapping

Kodo Workbench will generate a visual representation of the metadata and correponding mapping that Kodo will use at runtime to persist your data.

Each class and table for the selected mappings will be laid out as nodes of a graph on the canvas. Each class is represented in blue with the mapping icon beside the class name. Each table is in green with the table icon beside the table name. A basic amount of information is shown for each, such as column types and field names.

You can tailor the amount of information shown on the graph. By right clicking anywhere on the graph and selecting Edit Detail, a dialog offering visualization toggles will appear. Select what portions of the mappings and their related objects for the system to generate. You can also view a legend of line colors by right clicking on the graph and selecting View Legend. Each node is draggable by the mouse (click and drag) so that you can re-arrange the layout as you see fit.

In addition to the table and class nodes, one may also see yellow mapping nodes. For complex field mappings, Kodo Workbench will generate this node indicating the type of mapping used for the linked field. These lines are in green.

There are a number of other lines in the system which each represent a different part of the Kodo mapping system.

Table 4.1. Graph Edges

Line ColorDefinition
- Dark Blue Class Inheritance
- Dark Green Class Mapping
- Black Datastore Primary Key Column
- Light Green Field Mapping
- Light Blue Data Column
- Purple Key Column
- Orange Reference Source
- Red Reference Target
- Magenta Persistent related field type
- Yellow Element persistent type
- Dark Purple Key persistent type

This tool gives you a way to visualize the data in the way in which Kodo will see it at runtime. This can help prevent confusion as to what columns and tables Kodo expects from your schema. In addition, one can see how your classes will interact with your database and how cross-dependencies will line up.

You can close the visualization component by closing it like any other editor (File -> Close). The visualization component will also ask you if you want the graph regenerated after one of the visualized class mappings have changed.