db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r164082 - in /incubator/jdo/trunk/tck20/test: orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm sql/derby/schema1.sql sql/derby/schema2.sql
Date Thu, 21 Apr 2005 16:41:11 GMT
Author: mcaisse
Date: Thu Apr 21 09:41:09 2005
New Revision: 164082

URL: http://svn.apache.org/viewcvs?rev=164082&view=rev
Log:
JDO-7 metadata & schema for company

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/schema1.sql
    incubator/jdo/trunk/tck20/test/sql/derby/schema2.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=164082&r1=164081&r2=164082&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 Apr 21 09:41:09 2005
@@ -16,11 +16,9 @@
         </class>
 
         <class name="Company" table="companies">
-            <field name="companyid" primary-key="true"/>
-                <column name="ID"/>
+            <field name="companyid" column="ID" primary-key="true"/>
             <field name="name" column="NAME"/>
-            <field name="founded"/>
-                <column name="FOUNDEDDATE"/>
+            <field name="founded" column="FOUNDEDDATE"/>
             <field name="address">
                 <embedded null-indicator-column="COUNTRY">
                     <field name="street" column="STREET"/>
@@ -38,7 +36,8 @@
             <field name="name" column="NAME"/>
             <field name="company" column="COMPANYID"/>
             <field name="employees" mapped-by="department"/>
-            <field name="fundedEmps" mapped-by="fundingdept"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
         </class>
 
         <class name="PartTimeEmployee">
@@ -69,9 +68,7 @@
             <field name="mentor" column="MENTOR">
                         <foreign-key/>
             </field>
-            <field name="protege" column="PROTEGE">
-                        <foreign-key/>
-            </field>
+            <field name="protege" mapped-by="mentor"/>
             <field name="hradvisor" column="HRADVISOR">
                         <foreign-key/>
             </field>

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=164082&r1=164081&r2=164082&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 Apr 21 09:41:09 2005
@@ -36,7 +36,8 @@
             <field name="name" column="NAME"/>
             <field name="company" column="COMPANYID"/>
             <field name="employees" mapped-by="department"/>
-            <field name="fundedEmps" mapped-by="fundingdept"/>
+            <field name="fundedEmps" mapped-by="fundingDept"/>
+            <field name="employeeOfTheMonth" column="EMP_OF_THE_MONTH"/>
         </class>
 
         <class name="PartTimeEmployee">
@@ -67,9 +68,7 @@
             <field name="mentor" column="MENTOR">
                         <foreign-key/>
             </field>
-            <field name="protege" column="PROTEGE">
-                        <foreign-key/>
-            </field>
+            <field name="protege" mapped-by="mentor"/>
             <field name="hradvisor" column="HRADVISOR">
                         <foreign-key/>
             </field>

Modified: incubator/jdo/trunk/tck20/test/sql/derby/schema1.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/schema1.sql?rev=164082&r1=164081&r2=164082&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/schema1.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/schema1.sql Thu Apr 21 09:41:09 2005
@@ -55,32 +55,24 @@
 -------------------------
 -- company
 -------------------------
---CREATE TABLE addresses (
---    ADDRID INTEGER NOT NULL,
---    STREET VARCHAR(64) NOT NULL,
---    CITY VARCHAR(64) NOT NULL,
---    STATE CHAR(2) NOT NULL,
---    ZIPCODE CHAR(5) NOT NULL,
---    COUNTRY VARCHAR(64) NOT NULL,
---    CONSTRAINT ADDR_PK PRIMARY KEY (ID)
---);
 
 CREATE TABLE companies (
     ID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     FOUNDEDDATE VARCHAR(32) NOT NULL,
-    STREET VARCHAR(64) NOT NULL,
-    CITY VARCHAR(64) NOT NULL,
-    STATE CHAR(2) NOT NULL,
-    ZIPCODE CHAR(5) NOT NULL,
-    COUNTRY VARCHAR(64) NOT NULL,
+    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,
-    COMPANYID INTEGER REFERENCES COMPANIES NOT NULL,
+    EMP_OF_THE_MONTH INTEGER,
+    COMPANYID INTEGER REFERENCES companies,
     CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
 );
 
@@ -90,11 +82,11 @@
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
     BIRTHDATE VARCHAR(32) NOT NULL,
-    STREET VARCHAR(64) NOT NULL,
-    CITY VARCHAR(64) NOT NULL,
-    STATE CHAR(2) NOT NULL,
-    ZIPCODE CHAR(5) NOT NULL,
-    COUNTRY VARCHAR(64) NOT NULL,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
     HIREDATE VARCHAR(32) NOT NULL,
     WEEKLYHOURS FLOAT NOT NULL,
     DEPARTMENT INTEGER REFERENCES departments NOT NULL,
@@ -141,6 +133,11 @@
     TYPE VARCHAR(16) NOT NULL
 );
 
+ALTER TABLE departments (
+    ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
+        (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID)
+);
+
 -------------------------
 --fieldtypes
 -------------------------
@@ -148,6 +145,61 @@
 -------------------------
 --inheritance
 -------------------------
+
+CREATE TABLE AllPersist (
+    KEY_VALUE INTEGER NOT NULL,
+    DOUBLE_B DOUBLE,
+    FLOAT_E FLOAT,
+    SHORT_F SMALLINT,
+    SECOND_OBJ INTEGER,
+    THIRD_OBJ INTEGER,
+    INT_H INTEGER,
+    CONSTRAINT AllPersist_PK PRIMARY KEY (KEY_VALUE),
+    FOREIGN KEY (SECOND_OBJ) REFERENCES AllPersist (KEY_VALUE),
+    FOREIGN KEY (THIRD_OBJ) REFERENCES AllPersist (KEY_VALUE)
+);
+
+CREATE TABLE TopNonPersistB (
+    KEY_VALUE INTEGER NOT NULL,
+    DOUBLE_B DOUBLE,
+    INT_B INTEGER,
+    FLOAT_E FLOAT,
+    SHORT_F SMALLINT,
+    SECOND_OBJ INTEGER,
+    THIRD_OBJ INTEGER,
+    INT_H INTEGER,
+    CONSTRAINT TopNonPersistB_PK PRIMARY KEY (KEY_VALUE),
+    FOREIGN KEY (SECOND_OBJ) REFERENCES TopNonPersistB (KEY_VALUE),
+    FOREIGN KEY (THIRD_OBJ) REFERENCES TopNonPersistB (KEY_VALUE)
+);
+
+CREATE TABLE TopPersist (
+    KEY_VALUE INTEGER NOT NULL,
+    DOUBLE_B DOUBLE,
+    INT_B INTEGER,
+    FLOAT_E FLOAT,
+    SHORT_F SMALLINT,
+    SECOND_OBJ INTEGER,
+    THIRD_OBJ INTEGER,
+    INT_H INTEGER,
+    CONSTRAINT TopPersist_PK PRIMARY KEY (KEY_VALUE),
+    FOREIGN KEY (SECOND_OBJ) REFERENCES TopPersist (KEY_VALUE),
+    FOREIGN KEY (THIRD_OBJ) REFERENCES TopPersist (KEY_VALUE)
+);
+
+CREATE TABLE FieldSameName (
+    KEY_VALUE INTEGER NOT NULL,
+    N2 DOUBLE,
+    N3 INTEGER,
+    FSN2_N3 FLOAT,
+    FSN3_N1 SMALLINT,
+    FSN3_N2 INTEGER,
+    FSN3_N3 INTEGER,
+    FSN4_N3 INTEGER,
+    CONSTRAINT FieldSameName_PK PRIMARY KEY (KEY_VALUE),
+    FOREIGN KEY (FSN3_N2) REFERENCES FieldSameName (KEY_VALUE),
+    FOREIGN KEY (FSN3_N3) REFERENCES FieldSameName (KEY_VALUE)
+);
 
 -------------------------
 --instancecallbacks

Modified: incubator/jdo/trunk/tck20/test/sql/derby/schema2.sql
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/sql/derby/schema2.sql?rev=164082&r1=164081&r2=164082&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/sql/derby/schema2.sql (original)
+++ incubator/jdo/trunk/tck20/test/sql/derby/schema2.sql Thu Apr 21 09:41:09 2005
@@ -55,32 +55,24 @@
 -------------------------
 -- company
 -------------------------
---CREATE TABLE addresses (
---    ADDRID INTEGER NOT NULL,
---    STREET VARCHAR(64) NOT NULL,
---    CITY VARCHAR(64) NOT NULL,
---    STATE CHAR(2) NOT NULL,
---    ZIPCODE CHAR(5) NOT NULL,
---    COUNTRY VARCHAR(64) NOT NULL,
---    CONSTRAINT ADDR_PK PRIMARY KEY (ID)
---);
 
 CREATE TABLE companies (
     ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     NAME VARCHAR(32) NOT NULL,
     FOUNDEDDATE VARCHAR(32) NOT NULL,
-    STREET VARCHAR(64) NOT NULL,
-    CITY VARCHAR(64) NOT NULL,
-    STATE CHAR(2) NOT NULL,
-    ZIPCODE CHAR(5) NOT NULL,
-    COUNTRY VARCHAR(64) NOT NULL,
+    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 GENERATED ALWAYS AS IDENTITY,
     NAME VARCHAR(32) NOT NULL,
-    COMPANYID INTEGER REFERENCES COMPANIES NOT NULL,
+    EMP_OF_THE_MONTH INTEGER,
+    COMPANYID INTEGER REFERENCES companies,
     CONSTRAINT DEPTS_PK PRIMARY KEY (ID)
 );
 
@@ -90,11 +82,11 @@
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
     BIRTHDATE VARCHAR(32) NOT NULL,
-    STREET VARCHAR(64) NOT NULL,
-    CITY VARCHAR(64) NOT NULL,
-    STATE CHAR(2) NOT NULL,
-    ZIPCODE CHAR(5) NOT NULL,
-    COUNTRY VARCHAR(64) NOT NULL,
+    STREET VARCHAR(64),
+    CITY VARCHAR(64),
+    STATE CHAR(2),
+    ZIPCODE CHAR(5),
+    COUNTRY VARCHAR(64),
     HIREDATE VARCHAR(32) NOT NULL,
     WEEKLYHOURS FLOAT NOT NULL,
     DEPARTMENT INTEGER REFERENCES departments NOT NULL,
@@ -139,6 +131,11 @@
     empid INTEGER REFERENCES persons NOT NULL,
     phoneno VARCHAR(16) NOT NULL,
     type VARCHAR(16) NOT NULL
+);
+
+ALTER TABLE departments (
+    ADD CONSTRAINT EMP_MO_FK FOREIGN KEY
+        (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID)
 );
 
 -------------------------



Mime
View raw message