Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by KevinWilliams: http://wiki.apache.org/ws/WorkingWithRelationships ------------------------------------------------------------------------------ List orders = customer.getList("orders"); }}} - The client must also provide some mapping information in the configuration file to define to the DAS how the queried tables are related. + Notice that the example provides a config file as part of creating the DAS. This file contains mapping information that defines to the DAS how the queried tables are related. Here are the contents of the config file: + {{{ + <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <Table tableName="CUSTOMER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Table tableName="ANORDER"> + <Column columnName="ID" primaryKey="true"/> + </Table> + + <Relationship name="orders" primaryKeyTable="CUSTOMER" foreignKeyTable="ANORDER" many="true"> + <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/> + </Relationship> + + </Config> + }}} + + This config file specifies the primary keys of the related tables and then the relationship between them. It also provides a convienient name for the relationhip. In short, this config specifies that the CUSTOMER table and ANORDER table are related via ANORDERs column named "CUSTOMER_ID" which references CUSTOMERS column named "ID". As a side note, the config in this example is not required since the table definitions follow a "convention" recognized by the DAS. See + + + + + + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
