Foreign-key elements are used at the 'child-end' of a relation, i.e. on the table that actually defines the foreign key column. The iforeign-key element is used at the 'parent-end' of the relation, i.e. the table that has the primary key that the foreign key in the other table refers to.
Publishers are the parents and Titles are the children in the sample database. This gives you the following relation definitions:
<table name="publishers">
...
<iforeign-key foreignTable="titles" name="Titles" onDelete="setnull">
<ireference local="pub_id" foreign="pub_id"/>
</iforeign-key>
</table>
<table name="titles">
...
<foreign-key foreignTable="publishers" name="Publisher">
<reference local="pub_id" foreign="pub_id"/>
</foreign-key>
</table>
The 'i' stands for 'inverse' by the way.
Labels:
