db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r265046 [1/2] - in /incubator/jdo/trunk/tck20/test: conf/ orm/applicationidentity/org/apache/jdo/tck/pc/company/ orm/datastoreidentity/org/apache/jdo/tck/pc/company/ sql/derby/applicationidentity/ sql/derby/datastoreidentity/
Date Wed, 31 Aug 2005 14:11:06 GMT
Author: mbo
Date: Wed Aug 31 07:10:22 2005
New Revision: 265046

URL: http://svn.apache.org/viewcvs?rev=265046&view=rev
Log:
Added schema-, configuration- and orm-files for testing inheritance
mapping strategies. Changes provided by Michael Watzek.

Added:
    incubator/jdo/trunk/tck20/test/conf/inheritance1.conf
    incubator/jdo/trunk/tck20/test/conf/inheritance2.conf
    incubator/jdo/trunk/tck20/test/conf/inheritance3.conf
    incubator/jdo/trunk/tck20/test/conf/inheritance4.conf
    incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby1.orm
    incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby2.orm
    incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby3.orm
    incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby4.orm
    incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby1.orm
    incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm
    incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby3.orm
    incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby4.orm
    incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema1.sql
    incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema2.sql
    incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema3.sql
    incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema4.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema1.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema2.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema3.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema4.sql
Modified:
    incubator/jdo/trunk/tck20/test/conf/configurations.list

Modified: incubator/jdo/trunk/tck20/test/conf/configurations.list
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/configurations.list?rev=265046&r1=265045&r2=265046&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/conf/configurations.list (original)
+++ incubator/jdo/trunk/tck20/test/conf/configurations.list Wed Aug 31 07:10:22 2005
@@ -1,9 +1,13 @@
-jdo.tck.cfglist = \
-                 alltests.conf \
-                 companyNoRelationships.conf \
-                 companyEmbedded.conf \
-                 company1-1Relationships.conf \
-                 company1-MRelationships.conf \
-                 companyM-MRelationships.conf \
-                 companyAllRelationships.conf
-
+jdo.tck.cfglist = \
+                 alltests.conf \
+                 companyNoRelationships.conf \
+                 companyEmbedded.conf \
+                 company1-1Relationships.conf \
+                 company1-MRelationships.conf \
+                 companyM-MRelationships.conf \
+                 companyAllRelationships.conf \
+                 inheritance1.conf \
+                 inheritance2.conf \
+                 inheritance3.conf \
+                 inheritance4.conf
+

Added: incubator/jdo/trunk/tck20/test/conf/inheritance1.conf
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/inheritance1.conf?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/conf/inheritance1.conf (added)
+++ incubator/jdo/trunk/tck20/test/conf/inheritance1.conf Wed Aug 31 07:10:22 2005
@@ -0,0 +1,7 @@
+jdo.tck.description = Completeness test with inheritance mapping 1: \
+Separate table for each class in the inheritance hierarchy. \
+Each table contains columns for the declared fields. \
+Inheritance strategy: new-table for all classes.
+jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.mapping = 1

Added: incubator/jdo/trunk/tck20/test/conf/inheritance2.conf
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/inheritance2.conf?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/conf/inheritance2.conf (added)
+++ incubator/jdo/trunk/tck20/test/conf/inheritance2.conf Wed Aug 31 07:10:22 2005
@@ -0,0 +1,14 @@
+jdo.tck.description = Completeness test with inheritance mapping 2: \
+Separate table for each class in the inheritance hierarchy. \
+No tables for abstract classes. \
+Each table contains columns for all fields. \
+Managers, mentors, hradvisors, and employees of the month  \
+are fulltime employees. \
+Only fulltime employees can have insurances, can be project members, \
+and can be project reviewers. \
+Separate phone number type tables for persons, fulltime employees, \
+and parttime employees. \
+Inheritance strategy: new-table for all classes.
+jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.mapping = 2

Added: incubator/jdo/trunk/tck20/test/conf/inheritance3.conf
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/inheritance3.conf?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/conf/inheritance3.conf (added)
+++ incubator/jdo/trunk/tck20/test/conf/inheritance3.conf Wed Aug 31 07:10:22 2005
@@ -0,0 +1,9 @@
+jdo.tck.description = Completeness test with inheritance mapping 3: \
+Person has inheritance strategy "new-table". \
+Employee has inheritance strategy "subclass-table". \
+PartTimeEmployee and FullTimeEmployee has inheritance strategy "new-table". \
+Insurance has inheritance strategy "subclass-table". \
+MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
+jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.mapping = 3

Added: incubator/jdo/trunk/tck20/test/conf/inheritance4.conf
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/inheritance4.conf?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/conf/inheritance4.conf (added)
+++ incubator/jdo/trunk/tck20/test/conf/inheritance4.conf Wed Aug 31 07:10:22 2005
@@ -0,0 +1,7 @@
+jdo.tck.description = Completeness test with inheritance mapping 4: \
+Person, Employee, and Insurance have inheritance strategy "new-table". \
+PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance \
+have inheritance strategy "superclass-table".
+jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.mapping = 4

Added: incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby1.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby1.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby1.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby1.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has application identity.
+
+Inheritance mapping: 
+Separate table for each class in the inheritance hierarchy.
+Each table contains columns for the declared fields.
+Inheritance strategy: new-table for all classes.
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <field name="companyid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <field name="deptid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee" table="parttimeemployees">
+            <inheritance strategy="new-table">
+                <join column="PERSONID"/>
+            </inheritance>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee" table="fulltimeemployees">
+            <inheritance strategy="new-table">
+                <join column="PERSONID"/>
+            </inheritance>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee" table="employees">
+            <inheritance strategy="new-table">
+                <join column="PERSONID"/>
+            </inheritance>
+            <field name="hiredate" column="HIREDATE"/>
+            <field name="weeklyhours" column="WEEKLYHOURS"/>
+            <field name="dentalInsurance" mapped-by="employee"/>
+            <field name="medicalInsurance" mapped-by="employee"/>
+            <field name="department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="protege" mapped-by="mentor"/>
+            <field name="hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="reviewedProjects" mapped-by="reviewers">
+            </field>
+            <field name="projects" mapped-by="members"/>
+            <field name="team" mapped-by="manager"/>
+            <field name="hradvisees" mapped-by="hradvisor"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID" primary-key="true"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance" table="insuranceplans">
+            <inheritance strategy="new-table"/>
+            <field name="insid" column="INSID" primary-key="true"/>
+            <field name="carrier" column="CARRIER"/>
+            <field name="employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance" table="dentalinsurance">
+            <inheritance strategy="new-table">
+                <join column="INSID"/>
+            </inheritance>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance" table="medicalinsurance">
+            <inheritance strategy="new-table">
+                <join column="INSID"/>
+            </inheritance>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <field name="projid" column="PROJID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID">
+                    <foreign-key name="PR_PROJ_FK"/>
+                </join>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby2.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby2.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby2.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby2.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has application identity.
+
+Inheritance mapping: 
+Separate table for each class in the inheritance hierarchy.
+No tables for abstract classes.
+Each table contains columns for all fields.
+Managers, mentors, hradvisors, and employees of the month 
+are fulltime employees.
+Only fulltime employees can have insurances, can be project members,
+and can be project reviewers.
+Separate phone number type tables for persons, fulltime employees,
+and parttime employees.
+Inheritance strategy: 
+    Employee, Insurance: subclass-table.
+    all other classes:   new-table.
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <field name="companyid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <field name="deptid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee" table="parttimeemployees">
+            <inheritance strategy="new-table"/>
+            <field name="Person.personid" column="PERSONID" primary-key="true"/>
+            <field name="Person.firstname" column="FIRSTNAME"/>
+            <field name="Person.lastname" column="LASTNAME"/>
+            <field name="Person.middlename" column="MIDDLENAME"/>
+            <field name="Person.address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="Person.phoneNumbers" table="parttime_employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+            <field name="Employee.hiredate" column="HIREDATE"/>
+            <field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
+            <field name="Employee.dentalInsurance" mapped-by="employee"/>
+            <field name="Employee.medicalInsurance" mapped-by="employee"/>
+            <field name="Employee.department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.protege" mapped-by="mentor"/>
+            <field name="Employee.hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.reviewedProjects" mapped-by="reviewers">
+            </field>
+            <field name="Employee.projects" mapped-by="members"/>
+            <field name="Employee.team" mapped-by="manager"/>
+            <field name="Employee.hradvisees" mapped-by="hradvisor"/>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee" table="fulltimeemployees">
+            <inheritance strategy="new-table"/>
+            <field name="Person.personid" column="PERSONID" primary-key="true"/>
+            <field name="Person.firstname" column="FIRSTNAME"/>
+            <field name="Person.lastname" column="LASTNAME"/>
+            <field name="Person.middlename" column="MIDDLENAME"/>
+            <field name="Person.address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="Person.phoneNumbers" table="fulltime_employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+            <field name="Employee.hiredate" column="HIREDATE"/>
+            <field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
+            <field name="Employee.dentalInsurance" mapped-by="employee"/>
+            <field name="Employee.medicalInsurance" mapped-by="employee"/>
+            <field name="Employee.department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.protege" mapped-by="mentor"/>
+            <field name="Employee.hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.reviewedProjects" mapped-by="reviewers">
+            </field>
+            <field name="Employee.projects" mapped-by="members"/>
+            <field name="Employee.team" mapped-by="manager"/>
+            <field name="Employee.hradvisees" mapped-by="hradvisor"/>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee">
+            <inheritance strategy="subclass-table"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID" primary-key="true"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance">
+            <inheritance strategy="subclass-table"/>
+        </class>
+
+        <class name="DentalInsurance" table="dentalinsurance">
+            <inheritance strategy="new-table"/>
+            <field name="Insurance.insid" column="INSID" primary-key="true"/>
+            <field name="Insurance.carrier" column="CARRIER"/>
+            <field name="Insurance.employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance" table="medicalinsurance">
+            <inheritance strategy="new-table"/>
+            <field name="Insurance.insid" column="INSID" primary-key="true"/>
+            <field name="Insurance.carrier" column="CARRIER"/>
+            <field name="Insurance.employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <field name="projid" column="PROJID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID">
+                    <foreign-key name="PR_PROJ_FK"/>
+                </join>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby3.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby3.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby3.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby3.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has application identity.
+
+Inheritance mapping: 
+Person has inheritance strategy "new-table".
+Employee has inheritance strategy "subclass-table".
+PartTimeEmployee and FullTimeEmployee has inheritance strategy "new-table".
+Insurance has inheritance strategy "subclass-table".
+MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <field name="companyid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <field name="deptid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee" table="parttimeemployees">
+            <inheritance strategy="new-table">
+                <join column="PERSONID"/>
+            </inheritance>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee" table="fulltimeemployees">
+            <inheritance strategy="new-table">
+                <join column="PERSONID"/>
+            </inheritance>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee">
+            <inheritance strategy="subclass-table"/>
+            <field name="hiredate" column="HIREDATE"/>
+            <field name="weeklyhours" column="WEEKLYHOURS"/>
+            <field name="dentalInsurance" mapped-by="employee"/>
+            <field name="medicalInsurance" mapped-by="employee"/>
+            <field name="department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="protege" mapped-by="mentor"/>
+            <field name="hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="reviewedProjects" mapped-by="reviewers">
+            </field>
+            <field name="projects" mapped-by="members"/>
+            <field name="team" mapped-by="manager"/>
+            <field name="hradvisees" mapped-by="hradvisor"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID" primary-key="true"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance">
+            <inheritance strategy="subclass-table"/>
+            <field name="insid" column="INSID" primary-key="true"/>
+            <field name="carrier" column="CARRIER"/>
+            <field name="employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance" table="dentalinsurance">
+            <inheritance strategy="new-table"/>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance" table="medicalinsurance">
+            <inheritance strategy="new-table"/>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <field name="projid" column="PROJID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID">
+                    <foreign-key name="PR_PROJ_FK"/>
+                </join>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby4.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby4.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby4.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby4.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has application identity.
+
+Inheritance mapping: 
+Person, Employee, and Insurance have inheritance strategy "new-table". 
+PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance
+have inheritance strategy "superclass-table".
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <field name="companyid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <field name="deptid" column="ID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee">
+            <inheritance strategy="superclass-table"/>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee">
+            <inheritance strategy="superclass-table"/>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee" table="employees">
+            <inheritance strategy="new-table">
+                <join column="PERSONID"/>
+                <discriminator strategy="class-name" column="DISCRIMINATOR"
+                    indexed="true"/>
+            </inheritance>
+            <field name="hiredate" column="HIREDATE"/>
+            <field name="weeklyhours" column="WEEKLYHOURS"/>
+            <field name="dentalInsurance" mapped-by="employee"/>
+            <field name="medicalInsurance" mapped-by="employee"/>
+            <field name="department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="protege" mapped-by="mentor"/>
+            <field name="hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="reviewedProjects" mapped-by="reviewers">
+            </field>
+            <field name="projects" mapped-by="members"/>
+            <field name="team" mapped-by="manager"/>
+            <field name="hradvisees" mapped-by="hradvisor"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID" primary-key="true"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance" table="insuranceplans">
+            <inheritance strategy="new-table">
+                <discriminator strategy="class-name" column="DISCRIMINATOR"
+                    indexed="true"/>
+            </inheritance>
+            <field name="insid" column="INSID" primary-key="true"/>
+            <field name="carrier" column="CARRIER"/>
+            <field name="employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance">
+            <inheritance strategy="superclass-table"/>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance">
+            <inheritance strategy="superclass-table"/>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <field name="projid" column="PROJID" primary-key="true"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID">
+                    <foreign-key name="PR_PROJ_FK"/>
+                </join>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby1.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby1.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby1.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby1.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has datastore identity.
+
+Inheritance mapping: 
+Separate table for each class in the inheritance hierarchy.
+Each table contains columns for the declared fields.
+Inheritance strategy: new-table for all classes.
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="companyid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="deptid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee" table="parttimeemployees">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee" table="fulltimeemployees">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee" table="employees">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="hiredate" column="HIREDATE"/>
+            <field name="weeklyhours" column="WEEKLYHOURS"/>
+            <field name="dentalInsurance" mapped-by="employee"/>
+            <field name="medicalInsurance" mapped-by="employee"/>
+            <field name="department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="protege" mapped-by="mentor"/>
+            <field name="hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="reviewedProjects" mapped-by="reviewers">
+                <element>
+                    <foreign-key name="PR_PROJ_FK"/>
+                </element>
+            </field>
+            <field name="projects" mapped-by="members"/>
+            <field name="team" mapped-by="manager"/>
+            <field name="hradvisees" mapped-by="hradvisor"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance" table="insuranceplans">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="insid" column="INSID"/>
+            <field name="carrier" column="CARRIER"/>
+            <field name="employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance" table="dentalinsurance">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance" table="medicalinsurance">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="projid" column="PROJID"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID"/>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has datastore identity.
+
+Inheritance mapping: 
+Separate table for each class in the inheritance hierarchy.
+No tables for abstract classes.
+Each table contains columns for all fields.
+Managers, mentors, hradvisors, and employees of the month 
+are fulltime employees.
+Only fulltime employees can have insurances, can be project members,
+and can be project reviewers.
+Separate phone number type tables for persons, fulltime employees,
+and parttime employees.
+Inheritance strategy: 
+    Employee, Insurance: subclass-table.
+    all other classes:   new-table.
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="companyid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="deptid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee" table="parttimeemployees">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="Person.personid" column="PERSONID"/>
+            <field name="Person.firstname" column="FIRSTNAME"/>
+            <field name="Person.lastname" column="LASTNAME"/>
+            <field name="Person.middlename" column="MIDDLENAME"/>
+            <field name="Person.address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="Person.phoneNumbers" table="parttime_employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+            <field name="Employee.hiredate" column="HIREDATE"/>
+            <field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
+            <field name="Employee.dentalInsurance" mapped-by="employee"/>
+            <field name="Employee.medicalInsurance" mapped-by="employee"/>
+            <field name="Employee.department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.protege" mapped-by="mentor"/>
+            <field name="Employee.hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.reviewedProjects" mapped-by="reviewers">
+                <element>
+                    <foreign-key name="PR_PROJ_FK"/>
+                </element>
+            </field>
+            <field name="Employee.projects" mapped-by="members"/>
+            <field name="Employee.team" mapped-by="manager"/>
+            <field name="Employee.hradvisees" mapped-by="hradvisor"/>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee" table="fulltimeemployees">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="Person.personid" column="PERSONID"/>
+            <field name="Person.firstname" column="FIRSTNAME"/>
+            <field name="Person.lastname" column="LASTNAME"/>
+            <field name="Person.middlename" column="MIDDLENAME"/>
+            <field name="Person.address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="Person.phoneNumbers" table="fulltime_employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+            <field name="Employee.hiredate" column="HIREDATE"/>
+            <field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
+            <field name="Employee.dentalInsurance" mapped-by="employee"/>
+            <field name="Employee.medicalInsurance" mapped-by="employee"/>
+            <field name="Employee.department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.protege" mapped-by="mentor"/>
+            <field name="Employee.hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="Employee.reviewedProjects" mapped-by="reviewers">
+                <element>
+                    <foreign-key name="PR_PROJ_FK"/>
+                </element>
+            </field>
+            <field name="Employee.projects" mapped-by="members"/>
+            <field name="Employee.team" mapped-by="manager"/>
+            <field name="Employee.hradvisees" mapped-by="hradvisor"/>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee">
+            <inheritance strategy="subclass-table"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance">
+            <inheritance strategy="subclass-table"/>
+        </class>
+
+        <class name="DentalInsurance" table="dentalinsurance">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="Insurance.insid" column="INSID"/>
+            <field name="Insurance.carrier" column="CARRIER"/>
+            <field name="Insurance.employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance" table="medicalinsurance">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="Insurance.insid" column="INSID"/>
+            <field name="Insurance.carrier" column="CARRIER"/>
+            <field name="Insurance.employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="projid" column="PROJID"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID"/>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby3.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby3.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby3.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby3.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has datastore identity.
+
+Inheritance mapping: 
+Person has inheritance strategy "new-table".
+Employee has inheritance strategy "subclass-table".
+PartTimeEmployee and FullTimeEmployee has inheritance strategy "new-table".
+Insurance has inheritance strategy "subclass-table".
+MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="companyid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="deptid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee" table="parttimeemployees">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee" table="fulltimeemployees">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+            </inheritance>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee">
+            <inheritance strategy="subclass-table"/>
+            <field name="hiredate" column="HIREDATE"/>
+            <field name="weeklyhours" column="WEEKLYHOURS"/>
+            <field name="dentalInsurance" mapped-by="employee"/>
+            <field name="medicalInsurance" mapped-by="employee"/>
+            <field name="department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="protege" mapped-by="mentor"/>
+            <field name="hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="reviewedProjects" mapped-by="reviewers">
+                <element>
+                    <foreign-key name="PR_PROJ_FK"/>
+                </element>
+            </field>
+            <field name="projects" mapped-by="members"/>
+            <field name="team" mapped-by="manager"/>
+            <field name="hradvisees" mapped-by="hradvisor"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance" table="insuranceplans">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="subclass-table"/>
+            <field name="insid" column="INSID"/>
+            <field name="carrier" column="CARRIER"/>
+            <field name="employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance" table="dentalinsurance">
+            <inheritance strategy="new-table"/>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance" table="medicalinsurance">
+            <inheritance strategy="new-table"/>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="projid" column="PROJID"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID"/>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby4.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby4.orm?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby4.orm (added)
+++ incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby4.orm Wed Aug 31 07:10:22 2005
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has datastore identity.
+
+Inheritance mapping: 
+Person, Employee, and Insurance have inheritance strategy "new-table". 
+PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance
+have inheritance strategy "superclass-table".
+-->
+<orm>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Company" table="companies">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="companyid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="founded" column="FOUNDEDDATE"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="departments" mapped-by="company"/>
+        </class>
+
+        <class name="Department" table="departments">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="deptid" column="ID"/>
+            <field name="name" column="NAME"/>
+            <field name="company" column="COMPANYID" foreign-key="true"/>
+            <field name="employees" mapped-by="department"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
+        </class>
+
+        <class name="PartTimeEmployee">
+            <inheritance strategy="superclass-table"/>
+            <field name="wage" column="WAGE"/>
+        </class>
+
+        <class name="FullTimeEmployee">
+            <inheritance strategy="superclass-table"/>
+            <field name="salary" column="SALARY"/>
+        </class>
+
+        <class name="Employee" table="employees">
+            <inheritance strategy="new-table">
+                <join column="DATASTORE_IDENTITY"/>
+                <discriminator strategy="class-name" column="DISCRIMINATOR"
+                    indexed="true"/>
+            </inheritance>
+            <field name="hiredate" column="HIREDATE"/>
+            <field name="weeklyhours" column="WEEKLYHOURS"/>
+            <field name="dentalInsurance" mapped-by="employee"/>
+            <field name="medicalInsurance" mapped-by="employee"/>
+            <field name="department" column="DEPARTMENT">
+                        <foreign-key/>
+            </field>
+            <field name="fundingDept" column="FUNDINGDEPT">
+                        <foreign-key/>
+            </field>
+            <field name="manager" column="MANAGER">
+                        <foreign-key/>
+            </field>
+            <field name="mentor" column="MENTOR">
+                        <foreign-key/>
+            </field>
+            <field name="protege" mapped-by="mentor"/>
+            <field name="hradvisor" column="HRADVISOR">
+                        <foreign-key/>
+            </field>
+            <field name="reviewedProjects" mapped-by="reviewers">
+                <element>
+                    <foreign-key name="PR_PROJ_FK"/>
+                </element>
+            </field>
+            <field name="projects" mapped-by="members"/>
+            <field name="team" mapped-by="manager"/>
+            <field name="hradvisees" mapped-by="hradvisor"/>
+        </class>
+
+        <class name="Person" table="persons">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table"/>
+            <field name="personid" column="PERSONID"/>
+            <field name="firstname" column="FIRSTNAME"/>
+            <field name="lastname" column="LASTNAME"/>
+            <field name="middlename" column="MIDDLENAME"/>
+            <field name="address">
+                <embedded null-indicator-column="COUNTRY">
+                    <field name="addrid" column="ADDRID"/>
+                    <field name="street" column="STREET"/>
+                    <field name="city" column="CITY"/>
+                    <field name="state" column="STATE"/>
+                    <field name="zipcode" column="ZIPCODE"/>
+                    <field name="country" column="COUNTRY"/>
+                </embedded>
+            </field>
+            <field name="phoneNumbers" table="employee_phoneno_type" >
+                <join column="EMPID"/>
+                <key column="TYPE"/>
+                <value column="PHONENO"/>
+            </field>
+        </class>
+
+        <class name="Insurance" table="insuranceplans">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <inheritance strategy="new-table">
+                <discriminator strategy="class-name" column="DISCRIMINATOR"
+                    indexed="true"/>
+            </inheritance>
+            <field name="insid" column="INSID"/>
+            <field name="carrier" column="CARRIER"/>
+            <field name="employee" column="EMPLOYEE">
+                 <foreign-key/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance">
+            <inheritance strategy="superclass-table"/>
+            <field name="lifetimeOrthoBenefit" column="LIFETIME_ORTHO_BENEFIT"/>
+        </class>
+
+        <class name="MedicalInsurance">
+            <inheritance strategy="superclass-table"/>
+            <field name="planType" column="PLANTYPE"/>
+        </class>
+
+        <class name="Project" table="projects">
+            <datastore-identity strategy="identity" column="DATASTORE_IDENTITY"/>
+            <field name="projid" column="PROJID"/>
+            <field name="name" column="NAME"/>
+            <field name="budget">
+               <column name="BUDGET" jdbc-type="DECIMAL" length="11" scale="2"/>
+            </field>
+            <field name="reviewers" table="project_reviewer">
+                <join column="PROJID"/>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
+            </field>
+            <field name="members" table="project_member">
+                <join column="PROJID"/>
+                <element column="MEMBER"/>
+            </field>
+        </class>
+    </package>
+</orm>

Added: incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema1.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema1.sql?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema1.sql (added)
+++ incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema1.sql Wed Aug 31 07:10:22 2005
@@ -0,0 +1,154 @@
+-- SchemaType: application identity
+
+-- Inheritance mapping: 
+-- Separate table for each class in the inheritance hierarchy.
+-- Each table contains columns for the declared fields.
+-- See tables "persons", "employees", "parttimeemployees", 
+-- "fulltimeemployees", "insuranceplans", "medicalinsurance", and "dentalinsurance".
+
+connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser';
+
+CREATE SCHEMA applicationidentity1;
+SET SCHEMA applicationidentity1;
+
+-------------------------
+-- company
+-------------------------
+
+ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
+DROP TABLE dentalinsurance;
+DROP TABLE medicalinsurance;
+DROP TABLE insuranceplans;
+DROP TABLE project_reviewer;
+DROP TABLE project_member;
+DROP TABLE employee_phoneno_type;
+DROP TABLE fulltimeemployees;
+DROP TABLE parttimeemployees;
+DROP TABLE employees;
+DROP TABLE persons;
+DROP TABLE projects;
+DROP TABLE departments;
+DROP TABLE companies;
+
+CREATE TABLE companies (
+    ID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    FOUNDEDDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    CONSTRAINT COMPS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE departments (
+    ID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    EMP_OF_THE_MONTH INTEGER,
+    COMPANYID INTEGER REFERENCES companies,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE persons (
+    PERSONID INTEGER NOT NULL,
+    FIRSTNAME VARCHAR(32) NOT NULL,
+    LASTNAME VARCHAR(32) NOT NULL,
+    MIDDLENAME VARCHAR(32),
+    BIRTHDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    CONSTRAINT PERS_PK PRIMARY KEY (PERSONID)
+);
+
+CREATE TABLE employees (
+    PERSONID INTEGER NOT NULL,
+    HIREDATE VARCHAR(32),
+    WEEKLYHOURS FLOAT,
+    DEPARTMENT INTEGER REFERENCES departments,
+    FUNDINGDEPT INTEGER REFERENCES departments,
+    MANAGER INTEGER REFERENCES persons,
+    MENTOR INTEGER REFERENCES persons,
+    HRADVISOR INTEGER REFERENCES persons,
+    CONSTRAINT EMPS_PK PRIMARY KEY (PERSONID),
+    CONSTRAINT EMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID)
+);
+
+CREATE TABLE parttimeemployees (
+    PERSONID INTEGER NOT NULL,
+    WAGE FLOAT,
+    CONSTRAINT PTEMPS_PK PRIMARY KEY (PERSONID),
+    CONSTRAINT PTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID)
+);
+
+CREATE TABLE fulltimeemployees (
+    PERSONID INTEGER NOT NULL,
+    SALARY FLOAT,
+    CONSTRAINT FTEMPS_PK PRIMARY KEY (PERSONID),
+    CONSTRAINT FTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID)
+);
+
+CREATE TABLE insuranceplans (
+    INSID INTEGER NOT NULL,
+    CARRIER VARCHAR(64) NOT NULL,
+    EMPLOYEE INTEGER REFERENCES persons,
+    CONSTRAINT INS_PK PRIMARY KEY (INSID)
+);
+
+CREATE TABLE medicalinsurance (
+    INSID INTEGER NOT NULL,
+    PLANTYPE VARCHAR(8),
+    CONSTRAINT MEDINS_PK PRIMARY KEY (INSID),
+    CONSTRAINT MEDINS_FK FOREIGN KEY (INSID) REFERENCES insuranceplans (INSID)
+);
+
+CREATE TABLE dentalinsurance (
+    INSID INTEGER NOT NULL,
+    LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
+    CONSTRAINT DENTINS_PK PRIMARY KEY (INSID),
+    CONSTRAINT DENTINS_FK FOREIGN KEY (INSID) REFERENCES insuranceplans (INSID)
+);
+
+CREATE TABLE projects (
+    PROJID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    BUDGET DECIMAL(11,2) NOT NULL,
+    CONSTRAINT PROJS_PK PRIMARY KEY (PROJID)
+);
+
+CREATE TABLE project_reviewer (
+    PROJID INTEGER NOT NULL,
+    REVIEWER INTEGER NOT NULL
+);
+
+CREATE TABLE project_member (
+    PROJID INTEGER REFERENCES projects NOT NULL,
+    MEMBER INTEGER REFERENCES persons NOT NULL
+);
+
+CREATE TABLE employee_phoneno_type (
+    EMPID INTEGER REFERENCES persons NOT NULL,
+    PHONENO VARCHAR(16) NOT NULL,
+    TYPE VARCHAR(16) NOT NULL
+);
+
+ALTER TABLE project_reviewer 
+    ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects(PROJID);
+
+ALTER TABLE project_reviewer 
+    ADD CONSTRAINT PR_REV_FK FOREIGN KEY
+        (REVIEWER) REFERENCES persons(PERSONID);
+
+ALTER TABLE departments 
+    ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
+        (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID);
+
+disconnect;

Added: incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema2.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema2.sql?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema2.sql (added)
+++ incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema2.sql Wed Aug 31 07:10:22 2005
@@ -0,0 +1,188 @@
+-- SchemaType: application identity
+
+-- Inheritance mapping: 
+-- Separate table for each class in the inheritance hierarchy.
+-- No tables for abstract classes.
+-- Each table contains columns for all fields.
+-- Managers, mentors, hradvisors, and employees of the month 
+-- are fulltime employees.
+-- Only fulltime employees can have insurances, can be project members,
+-- and can be project reviewers.
+-- Separate phone number type tables for persons, fulltime employees,
+-- and parttime employees.
+-- See tables "persons", "parttimeemployees", 
+-- "fulltimeemployees", "medicalinsurance", "dentalinsurance",
+-- "fulltime_employee_phoneno_type", and "parttime_employee_phoneno_type".
+
+connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser';
+
+CREATE SCHEMA applicationidentity2;
+SET SCHEMA applicationidentity2;
+
+-------------------------
+-- company
+-------------------------
+
+ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
+DROP TABLE dentalinsurance;
+DROP TABLE medicalinsurance;
+DROP TABLE project_reviewer;
+DROP TABLE project_member;
+DROP TABLE employee_phoneno_type;
+DROP TABLE fulltime_employee_phoneno_type;
+DROP TABLE parttime_employee_phoneno_type;
+DROP TABLE parttimeemployees;
+DROP TABLE fulltimeemployees;
+DROP TABLE persons;
+DROP TABLE projects;
+DROP TABLE departments;
+DROP TABLE companies;
+
+CREATE TABLE companies (
+    ID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    FOUNDEDDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    CONSTRAINT COMPS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE departments (
+    ID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    EMP_OF_THE_MONTH INTEGER,
+    COMPANYID INTEGER REFERENCES companies,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE persons (
+    PERSONID INTEGER NOT NULL,
+    FIRSTNAME VARCHAR(32) NOT NULL,
+    LASTNAME VARCHAR(32) NOT NULL,
+    MIDDLENAME VARCHAR(32),
+    BIRTHDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    CONSTRAINT PERS_PK PRIMARY KEY (PERSONID)
+);
+
+CREATE TABLE fulltimeemployees (
+    PERSONID INTEGER NOT NULL,
+    FIRSTNAME VARCHAR(32) NOT NULL,
+    LASTNAME VARCHAR(32) NOT NULL,
+    MIDDLENAME VARCHAR(32),
+    BIRTHDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    HIREDATE VARCHAR(32),
+    WEEKLYHOURS FLOAT,
+    DEPARTMENT INTEGER REFERENCES departments,
+    FUNDINGDEPT INTEGER REFERENCES departments,
+    MANAGER INTEGER REFERENCES fulltimeemployees,
+    MENTOR INTEGER REFERENCES fulltimeemployees,
+    HRADVISOR INTEGER REFERENCES fulltimeemployees,
+    SALARY FLOAT,
+    CONSTRAINT FTEMPS_PK PRIMARY KEY (PERSONID)
+);
+
+CREATE TABLE parttimeemployees (
+    PERSONID INTEGER NOT NULL,
+    FIRSTNAME VARCHAR(32) NOT NULL,
+    LASTNAME VARCHAR(32) NOT NULL,
+    MIDDLENAME VARCHAR(32),
+    BIRTHDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    HIREDATE VARCHAR(32),
+    WEEKLYHOURS FLOAT,
+    DEPARTMENT INTEGER REFERENCES departments,
+    FUNDINGDEPT INTEGER REFERENCES departments,
+    MANAGER INTEGER REFERENCES fulltimeemployees,
+    MENTOR INTEGER REFERENCES fulltimeemployees,
+    HRADVISOR INTEGER REFERENCES fulltimeemployees,
+    WAGE FLOAT,
+    CONSTRAINT PTEMPS_PK PRIMARY KEY (PERSONID)
+);
+
+CREATE TABLE medicalinsurance (
+    INSID INTEGER NOT NULL,
+    CARRIER VARCHAR(64) NOT NULL,
+    EMPLOYEE INTEGER REFERENCES fulltimeemployees,
+    PLANTYPE VARCHAR(8),
+    CONSTRAINT MEDINS_PK PRIMARY KEY (INSID)
+);
+
+CREATE TABLE dentalinsurance (
+    INSID INTEGER NOT NULL,
+    CARRIER VARCHAR(64) NOT NULL,
+    EMPLOYEE INTEGER REFERENCES fulltimeemployees,
+    LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
+    CONSTRAINT DENTINS_PK PRIMARY KEY (INSID)
+);
+
+CREATE TABLE projects (
+    PROJID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    BUDGET DECIMAL(11,2) NOT NULL,
+    CONSTRAINT PROJS_PK PRIMARY KEY (PROJID)
+);
+
+CREATE TABLE project_reviewer (
+    PROJID INTEGER NOT NULL,
+    REVIEWER INTEGER NOT NULL
+);
+
+CREATE TABLE project_member (
+    PROJID INTEGER REFERENCES projects NOT NULL,
+    MEMBER INTEGER REFERENCES fulltimeemployees NOT NULL
+);
+
+CREATE TABLE employee_phoneno_type (
+    EMPID INTEGER REFERENCES persons NOT NULL,
+    PHONENO VARCHAR(16) NOT NULL,
+    TYPE VARCHAR(16) NOT NULL
+);
+
+CREATE TABLE fulltime_employee_phoneno_type (
+    EMPID INTEGER REFERENCES fulltimeemployees NOT NULL,
+    PHONENO VARCHAR(16) NOT NULL,
+    TYPE VARCHAR(16) NOT NULL
+);
+
+CREATE TABLE parttime_employee_phoneno_type (
+    EMPID INTEGER REFERENCES parttimeemployees NOT NULL,
+    PHONENO VARCHAR(16) NOT NULL,
+    TYPE VARCHAR(16) NOT NULL
+);
+
+ALTER TABLE project_reviewer 
+    ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects(PROJID);
+
+ALTER TABLE project_reviewer 
+    ADD CONSTRAINT PR_REV_FK FOREIGN KEY
+        (REVIEWER) REFERENCES fulltimeemployees(PERSONID);
+
+ALTER TABLE departments 
+    ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
+        (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees(PERSONID);
+
+disconnect;

Added: incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema3.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema3.sql?rev=265046&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema3.sql (added)
+++ incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema3.sql Wed Aug 31 07:10:22 2005
@@ -0,0 +1,151 @@
+-- SchemaType: application identity
+
+-- Inheritance mapping: 
+-- Person has inheritance strategy "new-table".
+-- Employee has inheritance strategy "subclass-table".
+-- PartTimeEmployee and FullTimeEmployee have inheritance strategy "new-table".
+-- Insurance has inheritance strategy "subclass-table".
+-- MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
+-- See tables "persons", "parttimeemployees", "fulltimeemployees",
+-- "medicalinsurance" and "dentalinsurance".
+
+connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser';
+
+CREATE SCHEMA applicationidentity3;
+SET SCHEMA applicationidentity3;
+
+-------------------------
+-- company
+-------------------------
+
+ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
+DROP TABLE dentalinsurance;
+DROP TABLE medicalinsurance;
+DROP TABLE project_reviewer;
+DROP TABLE project_member;
+DROP TABLE employee_phoneno_type;
+DROP TABLE fulltimeemployees;
+DROP TABLE parttimeemployees;
+DROP TABLE persons;
+DROP TABLE projects;
+DROP TABLE departments;
+DROP TABLE companies;
+
+CREATE TABLE companies (
+    ID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    FOUNDEDDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    CONSTRAINT COMPS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE departments (
+    ID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    EMP_OF_THE_MONTH INTEGER,
+    COMPANYID INTEGER REFERENCES companies,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
+);
+
+CREATE TABLE persons (
+    PERSONID INTEGER NOT NULL,
+    FIRSTNAME VARCHAR(32) NOT NULL,
+    LASTNAME VARCHAR(32) NOT NULL,
+    MIDDLENAME VARCHAR(32),
+    BIRTHDATE VARCHAR(32) NOT NULL,
+    ADDRID INTEGER,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
+    CONSTRAINT PERS_PK PRIMARY KEY (PERSONID)
+);
+
+CREATE TABLE parttimeemployees (
+    PERSONID INTEGER NOT NULL,
+    HIREDATE VARCHAR(32),
+    WEEKLYHOURS FLOAT,
+    DEPARTMENT INTEGER REFERENCES departments,
+    FUNDINGDEPT INTEGER REFERENCES departments,
+    MANAGER INTEGER REFERENCES persons,
+    MENTOR INTEGER REFERENCES persons,
+    HRADVISOR INTEGER REFERENCES persons,
+    WAGE FLOAT,
+    CONSTRAINT PTEMPS_PK PRIMARY KEY (PERSONID),
+    CONSTRAINT PTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID)
+);
+
+CREATE TABLE fulltimeemployees (
+    PERSONID INTEGER NOT NULL,
+    HIREDATE VARCHAR(32),
+    WEEKLYHOURS FLOAT,
+    DEPARTMENT INTEGER REFERENCES departments,
+    FUNDINGDEPT INTEGER REFERENCES departments,
+    MANAGER INTEGER REFERENCES persons,
+    MENTOR INTEGER REFERENCES persons,
+    HRADVISOR INTEGER REFERENCES persons,
+    SALARY FLOAT,
+    CONSTRAINT FTEMPS_PK PRIMARY KEY (PERSONID),
+    CONSTRAINT FTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID)
+);
+
+CREATE TABLE medicalinsurance (
+    INSID INTEGER NOT NULL,
+    CARRIER VARCHAR(64) NOT NULL,
+    EMPLOYEE INTEGER REFERENCES persons,
+    PLANTYPE VARCHAR(8),
+    CONSTRAINT MEDINS_PK PRIMARY KEY (INSID)
+);
+
+CREATE TABLE dentalinsurance (
+    INSID INTEGER NOT NULL,
+    CARRIER VARCHAR(64) NOT NULL,
+    EMPLOYEE INTEGER REFERENCES persons,
+    LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
+    CONSTRAINT DENTINS_PK PRIMARY KEY (INSID)
+);
+
+CREATE TABLE projects (
+    PROJID INTEGER NOT NULL,
+    NAME VARCHAR(32) NOT NULL,
+    BUDGET DECIMAL(11,2) NOT NULL,
+    CONSTRAINT PROJS_PK PRIMARY KEY (PROJID)
+);
+
+CREATE TABLE project_reviewer (
+    PROJID INTEGER NOT NULL,
+    REVIEWER INTEGER NOT NULL
+);
+
+CREATE TABLE project_member (
+    PROJID INTEGER REFERENCES projects NOT NULL,
+    MEMBER INTEGER REFERENCES persons NOT NULL
+);
+
+CREATE TABLE employee_phoneno_type (
+    EMPID INTEGER REFERENCES persons NOT NULL,
+    PHONENO VARCHAR(16) NOT NULL,
+    TYPE VARCHAR(16) NOT NULL
+);
+
+ALTER TABLE project_reviewer 
+    ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
+        (PROJID) REFERENCES projects(PROJID);
+
+ALTER TABLE project_reviewer 
+    ADD CONSTRAINT PR_REV_FK FOREIGN KEY
+        (REVIEWER) REFERENCES persons(PERSONID);
+
+ALTER TABLE departments 
+    ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
+        (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID);
+
+disconnect;



Mime
View raw message