For example, consider the following item descriptors, which define an author
repository item type and an address
repository item type. The address
property of the author
repository item type has the attribute item-type="address"
, indicating that the value of the address of an author
is a repository item of type address
. The address
property has the attribute cascade="insert,update,delete"
; as a result, whenever an author
type repository item is created, added, updated, or deleted, the corresponding address
repository item is also.
<!-- The "author" item type --> <item-descriptor name="author"> <table name="author" id-column-names="author_id" type="primary"> <property name="name"/> <property name="address" item-type="address" cascade="insert,update,delete"/> </table> </item-descriptor> <!-- The "address" item type --> <item-descriptor name="address"> <table name="address" id-column-names="address_id" type="primary"> <property name="streetAddress"/> <property name="city"/> <property name="state"/> <property name="zip"/> </table> </item-descriptor>