ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
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:
http://wiki.apache.org/ws/CompoundKeys

New page:
The RDB DAS provides the ability to work with single-column keys as well as [http://en.wikipedia.org/wiki/Compound_key
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
compound.

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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	
   <Table tableName="ORDERDETAILS">
      <Column columnName="ORDERID" primaryKey="true"/>
      <Column columnName="PRODUCTID" primaryKey="true"/>
    </Table>
 
    <Table tableName="ANORDER">
       <Column columnName="ID" primaryKey="true"/>
    </Table>
	   
   <Relationship name="ORDERDETAILS" primaryKeyTable="ANORDER"
        foreignKeyTable="ORDERDETAILS" many="true">
        <KeyPair primaryKeyColumn="ID" foreignKeyColumn="ORDERID"/>
    </Relationship>
    
</Config>
}}}

To be continued ...
 ConventionOverConfiguration

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@ws.apache.org
For additional commands, e-mail: general-help@ws.apache.org


Mime
View raw message