This example maps out a one-to-many relationship between user items and address items. It demonstrates the use of the component-item-type attribute, which allows one repository item to contain other repository items. Each user item can contain many address items, such as home address, shipping address, business address.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE gsa-template
PUBLIC "-//Art Technology Group, Inc.//DTD Dynamo Security//EN"
    <name>Repository Mapping Example Version F</name>
    <author>Ben Erwin</author>
This template maps out a one-to-many relationship
between user items and address items. It
demonstrates the use of the component-item-type
attribute (which allows one repository item
to contain other repository items.) Each user
item will contain many address items (home address,
business address, etc.)
  <item-descriptor name="address">
    <table name="addr_tbl" type="primary" id-column-name="addr_id">
        <property name="user" column-name="user_id" item-type="user"/>
        <property name="street" data-type="string"/>
        <property name="city" data-type="string"/>
  <item-descriptor name="user" default="true">
    <table name="usr_tbl" type="primary" id-column-name="id">
        <property name="id" data-type="string"/>
        <property name="name" column-name="nam_col" data-type="string"/>
        <property name="age" column-name="age_col" data-type="string"/>
    <table name="addr_tbl" type="multi" id-column-name="user_id">
        <property name="addresses" column-name="addr_id" data-type="set"
SQL Statements
CREATE TABLE usr_tbl (
  id VARCHAR(32) not null,
  nam_col VARCHAR(32) null,
  age_col VARCHAR(32) null,
  primary key(id)

CREATE TABLE addr_tbl (
  addr_id VARCHAR(32) not null,
  user_id VARCHAR(32) null references usr_tbl(id),
  street VARCHAR(32) null,
  city VARCHAR(32) null,
  primary key(addr_id)

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices