Files
ofbiz-framework/framework/entity/entitydef/entitymodel_test.xml
T
2006-07-20 10:57:51 +00:00

149 lines
6.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2001-2006 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.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
<title>Entity testing suite</title>
<description>None</description>
<copyright>Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org</copyright>
<author>Manuel Meyer</author>
<author>Si Chen</author>
<version>1.0</version>
<!-- =========================================================
For the test, testing is the basic entity.
It can have a type represented by TestingType, and can be a member of a TestingNode.
TestingNodes represent a hierarchy of Node, each Node can have one parent
and many children.
A TestingNodeMember can be member of many TestingNodes.
========================================================= -->
<!-- ======================== Data Model ===================== -->
<!-- The modules in this file are as follows: -->
<!-- - org.ofbiz.entity.test -->
<!-- ========================================================= -->
<!-- =========================================================
The testing entity is a basic entity with a type
========================================================= -->
<entity entity-name="Testing"
package-name="org.ofbiz.entity.test"
title="Testing Entity">
<field name="testingId" type="id-ne"/>
<field name="testingTypeId" type="id-ne"/>
<field name="testingName" type="name"/>
<field name="description" type="description"/>
<field name="comments" type="comment"/>
<field name="testingSize" type="numeric"/>
<field name="testingDate" type="date-time"/>
<prim-key field="testingId"/>
<relation type="one" fk-name="ENTITY_ENTY_TYP" rel-entity-name="TestingType">
<key-map field-name="testingTypeId"/>
</relation>
</entity>
<!-- =========================================================
Testing entity type
========================================================= -->
<entity entity-name="TestingType"
package-name="org.ofbiz.entity.test"
title="Testing Entity Type">
<field name="testingTypeId" type="id-ne"/>
<field name="description" type="description"/>
<prim-key field="testingTypeId"/>
</entity>
<!-- =========================================================
An entity for testing the BLOB data type
========================================================== -->
<entity entity-name="TestBlob"
package-name="org.ofbiz.entity.test"
title="Entity for testing the blob type">
<field name="testBlobId" type="id-ne"/>
<field name="testBlobField" type="blob"/>
<prim-key field="testBlobId"/>
</entity>
<!-- =========================================================
Testing Node entity : hierachy of nodes having
'testing node member' as potential members
========================================================= -->
<entity entity-name="TestingNode"
package-name="org.ofbiz.entity.test"
title="Testing Node">
<field name="testingNodeId" type="id-ne"></field>
<field name="primaryParentNodeId" type="id"></field>
<field name="description" type="description"></field>
<prim-key field="testingNodeId"/>
<relation type="one" fk-name="TESTNG_NDE_PARNT" title="PrimaryParent" rel-entity-name="TestingNode">
<key-map field-name="primaryParentNodeId" rel-field-name="testingNodeId"/>
</relation>
<relation type="many" title="PrimaryChild" rel-entity-name="TestingNode">
<key-map field-name="testingNodeId" rel-field-name="primaryParentNodeId"/>
</relation>
</entity>
<!-- =========================================================
Testing Node member
A testing member entity can belong to any testing node
========================================================= -->
<entity entity-name="TestingNodeMember"
package-name="org.ofbiz.entity.test"
title="Testing Node Member">
<field name="testingNodeId" type="id-ne"></field>
<field name="testingId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<prim-key field="testingNodeId"/>
<prim-key field="testingId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="TESTING_NMBR_TEST" rel-entity-name="Testing">
<key-map field-name="testingId"/>
</relation>
<relation type="one" fk-name="TEST_NMBR_NODE" rel-entity-name="TestingNode">
<key-map field-name="testingNodeId"/>
</relation>
</entity>
<!-- =========================================================
View : a Testing Node with its member(s)
========================================================= -->
<view-entity entity-name="TestingNodeAndMember"
package-name="org.ofbiz.entity.test"
title="TestingNode And TestingNodeMember View">
<member-entity entity-alias="TN" entity-name="TestingNode"/>
<member-entity entity-alias="TNM" entity-name="TestingNodeMember"/>
<alias-all entity-alias="TN"/>
<alias-all entity-alias="TNM"/>
<view-link entity-alias="TN" rel-entity-alias="TNM">
<key-map field-name="testingNodeId"/>
</view-link>
<relation type="one-nofk" rel-entity-name="TestingNodeMember">
<key-map field-name="testingNodeId"/>
<key-map field-name="testingId"/>
<key-map field-name="fromDate"/>
</relation>
<relation type="one-nofk" rel-entity-name="TestingNode">
<key-map field-name="testingNodeId"/>
</relation>
<relation type="one-nofk" rel-entity-name="Testing">
<key-map field-name="testingId"/>
</relation>
</view-entity>
</entitymodel>