ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Ws Wiki] Update of "CompoundKeys" by KevinWilliams
Date Thu, 12 Oct 2006 03:17:30 GMT
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:

New page:
The RDB DAS provides the ability to work with single-column keys as well as [
compound keys].  Keys must be identified to the DAS for two purposes: flushing changes to
the database and defining a relationship.  In either case, the keys can be single-colomn or

We'll start with the first purpose: flushing changes to the database (also called "apply changes
processing").  As part of change summary processing, the DAS will generate a set of INSERT,
UPDATE and DELETE statements for execution against the database and these statements require
a primary key.  So, although the primary key definition is not required for reading data,
it is required for writeing data via apply changes processing.

The primary key for a table can be identified to the DAS via configuration (typically via
a configuration xml file).  The follwing is an example config file that defines a compound
primary key:

   <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd"
   <Table tableName="ORDERDETAILS">
      <Column columnName="ORDERID" primaryKey="true"/>
      <Column columnName="PRODUCTID" primaryKey="true"/>
    <Table tableName="ANORDER">
       <Column columnName="ID" primaryKey="true"/>
   <Relationship name="ORDERDETAILS" primaryKeyTable="ANORDER"
        foreignKeyTable="ORDERDETAILS" many="true">
        <KeyPair primaryKeyColumn="ID" foreignKeyColumn="ORDERID"/>

To be continued ...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message