<!--
Copyright 2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<descriptor-repository version="1.0">

	<!--
	   - N O D E
	-->	
	<class-descriptor
    	class="org.apache.jetspeed.prefs.om.impl.NodeImpl"
	    table="PREFS_NODE"
	>
    	<documentation>Represents a preferences node.</documentation>
	    <field-descriptor
    	    name="nodeId"
	        column="NODE_ID"
    	    jdbc-type="BIGINT"
        	primarykey="true"
	        autoincrement="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="parentNodeId"
	        column="PARENT_NODE_ID"
	        jdbc-type="BIGINT"
	        nullable="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="nodeName"
	        column="NODE_NAME"
	        jdbc-type="VARCHAR"
	        nullable="false"
	        length="100"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="nodeType"
	        column="NODE_TYPE"
	        jdbc-type="SMALLINT"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="fullPath"
	        column="FULL_PATH"
	        jdbc-type="VARCHAR"
	        nullable="false"
	        length="254"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="creationDate"
	        column="CREATION_DATE"
	        jdbc-type="TIMESTAMP"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="modifiedDate"
	        column="MODIFIED_DATE"
	        jdbc-type="TIMESTAMP"
	        nullable="false"
	    >
	    </field-descriptor>
	    <collection-descriptor
	        name="nodeKeys"
	        element-class-ref="org.apache.jetspeed.prefs.om.impl.PropertyKeyImpl"
	        auto-retrieve="true"
	        auto-delete="false"
	        auto-update="true"
	        indirection-table="PREFS_NODE_PROPERTY_KEY"
	    >
	        <documentation>This is the reference to the property keys allowed for that node.</documentation>
	        <fk-pointing-to-this-class column="NODE_ID"/>
	        <fk-pointing-to-element-class column="PROPERTY_KEY_ID"/>
	    </collection-descriptor>
	    <collection-descriptor
	        name="nodeProperties"
	        element-class-ref="org.apache.jetspeed.prefs.om.impl.PropertyImpl"
	        auto-retrieve="true"
	        auto-update="true"
	        auto-delete="true"
	        refresh="true"
	    >
	        <documentation>This is the reference to a node properties.</documentation>
	        <inverse-foreignkey field-ref="nodeId"/>
	    </collection-descriptor>
	</class-descriptor>
	
	<!--
	   - P R O P E R T Y  K E Y
	-->	
	
	<class-descriptor
	    class="org.apache.jetspeed.prefs.om.impl.PropertyKeyImpl"
	    table="PREFS_PROPERTY_KEY"
	>
	    <documentation>Represents a property key.</documentation>
	    <field-descriptor
	        name="propertyKeyId"
	        column="PROPERTY_KEY_ID"
	        jdbc-type="BIGINT"
	        primarykey="true"
	        autoincrement="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="propertyKeyName"
	        column="PROPERTY_NAME"
	        jdbc-type="VARCHAR"
	        nullable="false"
	        length="100"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="propertyKeyType"
	        column="PROPERTY_TYPE"
	        jdbc-type="SMALLINT"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="creationDate"
	        column="CREATION_DATE"
	        jdbc-type="TIMESTAMP"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="modifiedDate"
	        column="MODIFIED_DATE"
	        jdbc-type="TIMESTAMP"
	        nullable="false"
	    >
	    </field-descriptor>
	</class-descriptor>
	
	<!--
	   - P R O P E R T Y
	-->	
	
	<class-descriptor
	    class="org.apache.jetspeed.prefs.om.impl.PropertyImpl"
	    table="PREFS_PROPERTY_VALUE"
	>
	    <documentation>Represents a property key/value pair.</documentation>
	    <field-descriptor
	        name="propertyValueId"
	        column="PROPERTY_VALUE_ID"
	        jdbc-type="BIGINT"
	        primarykey="true"
	        autoincrement="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="nodeId"
	        column="NODE_ID"
	        jdbc-type="BIGINT"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="propertyKeyId"
	        column="PROPERTY_KEY_ID"
	        jdbc-type="BIGINT"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="booleanPropertyValue"
	        column="BOOLEAN_VALUE"
	        jdbc-type="BIT"
	        nullable="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="datePropertyValue"
	        column="DATETIME_VALUE"
	        jdbc-type="TIMESTAMP"
	        nullable="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="longPropertyValue"
	        column="LONG_VALUE"
	        jdbc-type="BIGINT"
	        nullable="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="doublePropertyValue"
	        column="DOUBLE_VALUE"
	        jdbc-type="DOUBLE"
	        nullable="true"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="textPropertyValue"
	        column="TEXT_VALUE"
	        jdbc-type="VARCHAR"
	        nullable="true"
	        length="254"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="creationDate"
	        column="CREATION_DATE"
	        jdbc-type="TIMESTAMP"
	        nullable="false"
	    >
	    </field-descriptor>
	    <field-descriptor
	        name="modifiedDate"
	        column="MODIFIED_DATE"
	        jdbc-type="TIMESTAMP"
	        nullable="false"
	    >
	    </field-descriptor>
	    <reference-descriptor
	        name="propertyKey"
	        class-ref="org.apache.jetspeed.prefs.om.impl.PropertyKeyImpl"
	        refresh="true"
	        auto-retrieve="true"
	        auto-delete="false"
	        auto-update="true"
	    >
	        <documentation>This is the reference to a property key.</documentation>
	        <foreignkey field-ref="propertyKeyId"/>
	    </reference-descriptor>
	</class-descriptor>
	
</descriptor-repository>