This is a case where a class is mapped to multiple TABLE.
Class called Address:
The surface structure is as follows:
Create Table Addr
Street varchar (255) Primary Key,
City varchar (255),
State Char (2),
Zipcode Varchar (10)
)
Create Table Deliv
Addr_Street Varchar (255),
SIG_REQUIRED BIT,
Deliv_ins clob
)
Create Table Mapquest_info
Addr_Street Varchar (255),
Mapquest_image blob
)
The contents of the mapping file are as follows:
field>
field>
clas>
package>
om>
Interpretation:
Here, this element is used to map multiple tables to a Class, and we call the Class's Table as a primary table, and other tabs. Use two ways:
1.
field>
Column = "addr_street" indicates that the table deliv is associated with the primary table (that is, addr) through the addr_street.
2. A file map is mapped to a sub-table:
field>
Similarly, the column = "addr_street" in the join element indicates that the primary table (that is, addr) is associated with the primary table (i.e., addr) by addr_street.
It should be noted that the associated column must be a primary key.
Using this file, we open a Class to map to multiple Tables.