Hi Michelle,

Could you please tell us what this patch does? It doesn't make sense to me.

Craig

On Jul 21, 2005, at 4:56 PM, mcaisse@apache.org wrote:

Author: mcaisse
Date: Thu Jul 21 16:56:25 2005
New Revision: 220215

URL: http://svn.apache.org/viewcvs?rev=220215&view=rev
Log:
Add <foreign-key name> to company metadata

Modified:
    incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm
    incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm
    incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql
    incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql

Modified: incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm?rev=220215&r1=220214&r2=220215&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm (original)
+++ incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm Thu Jul 21 16:56:25 2005
@@ -65,7 +65,11 @@
             <field name="hradvisor" column="HRADVISOR">
                         <foreign-key/>
             </field>
-            <field name="reviewedProjects" mapped-by="reviewers"/>
+            <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"/>
@@ -125,7 +129,9 @@
             </field>
             <field name="reviewers" table="project_reviewer">
                 <join column="PROJID"/>
-                <element column="REVIEWER"/>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_PROJ_FK"/>
+                </element>
             </field>
             <field name="members" table="project_member">
                 <join column="PROJID"/>

Modified: incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm?rev=220215&r1=220214&r2=220215&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm (original)
+++ incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm Thu Jul 21 16:56:25 2005
@@ -67,7 +67,11 @@
             <field name="hradvisor" column="HRADVISOR">
                         <foreign-key/>
             </field>
-            <field name="reviewedProjects" mapped-by="reviewers"/>
+            <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"/>
@@ -130,7 +134,9 @@
             </field>
             <field name="reviewers" table="project_reviewer">
                 <join column="PROJID"/>
-                <element column="REVIEWER"/>
+                <element column="REVIEWER">
+                    <foreign-key name="PR_REV_FK"/>
+                </element>
             </field>
             <field name="members" table="project_member">
                 <join column="PROJID"/>

Modified: incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql?rev=220215&r1=220214&r2=220215&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql Thu Jul 21 16:56:25 2005
@@ -127,6 +127,8 @@
 -------------------------

 ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK FOREIGN KEY;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_MEM_FK FOREIGN KEY;
 DROP TABLE insuranceplans;
 DROP TABLE project_reviewer;
 DROP TABLE project_member;
@@ -205,8 +207,8 @@
 );

 CREATE TABLE project_member (
-    PROJID INTEGER REFERENCES projects NOT NULL,
-    MEMBER INTEGER REFERENCES persons NOT NULL
+    PROJID INTEGER NOT NULL,
+    MEMBER INTEGER NOT NULL
 );

 CREATE TABLE employee_phoneno_type (
@@ -214,6 +216,13 @@
     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)
+    ADD CONSTRAINT PR_REV_FK FOREIGN KEY
+        (REVIEWER) REFERENCES persons(PERSONID)
+;

 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY

Modified: incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql?rev=220215&r1=220214&r2=220215&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql Thu Jul 21 16:56:25 2005
@@ -70,6 +70,8 @@
 -------------------------

 ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK FOREIGN KEY;
+ALTER TABLE project_reviewer DROP CONSTRAINT PR_MEM_FK FOREIGN KEY;
 DROP TABLE insuranceplans;
 DROP TABLE project_reviewer;
 DROP TABLE project_member;
@@ -162,6 +164,13 @@
     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)
+    ADD CONSTRAINT PR_REV_FK FOREIGN KEY
+        (REVIEWER) REFERENCES persons(PERSONID)
+;

 ALTER TABLE departments 
     ADD CONSTRAINT EMP_MO_FK FOREIGN KEY




Craig Russell

Architect, Sun Java Enterprise System http://java.sun.com/products/jdo

408 276-5638 mailto:Craig.Russell@sun.com

P.S. A good JDO? O, Gasp!