Defining Entity Class Mapping

In order to define mapping for entity classes, you have to:


You can also click the Add objects tool in the Class Sources sub-tab of the Mapping tab after you created the class mapping.



You can add tables, views and references as mapping sources. There are some constraints on views as mapping sources, as some views cannot be updated. When you add references as mapping sources, tables at the two ends will also be added.

You can add multiple tables as mapping sources. Usually, the first table you add is called the primary table. Other tables are called secondary tables. Each secondary table should have reference key referring to primary table, which is joined on its primary key.

Given the following class Customer:



It can be mapped to two tables:



The Customer table is the primary table. The CutomerInfo table is the secondary table and it has one reference key referring to the primary table, which is joined on its primary key.

With the Mapping Editor, you just have to drag the two tables and drop them to class Customer to define class mappings.




Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com