You can use an XML template to add repository items. Use an <add-item> tag for each repository item you want to add. Each <add-item> tag must include an item-descriptor attribute to specify the name of the item descriptor to which this repository item should belong. You can nest <set-property> tags within the <add-item> tag to set property values of the new repository item. Any properties you do not set have the default property value for that item descriptor.

For example, the following tags add to the database an instance of users with id = 1. It sets the username property to Marty.

<add-item item-descriptor="users" id="1">
    <set-property name="username" value="Marty"/>
</add-item>

Note that <add-item> tags are processed one at a time. They cannot make forward references to other items and no attempt is made to satisfy database integrity constraints (beyond that automatically done with the cascade operator). Use the <import-items> tag if you want to load in items with forward references.

Note also that if you specify the ID of an existing repository item, you update that item, overwriting the values of the existing item with the values you specify in the <add-item> tag. Any add or remove attributes in a <set-property> tag within an <add-item> tag are ignored.


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