db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r374467 - in /db/jdo/trunk/tck20/src/sql/derby/datastoreidentity: schema.sql schema1.sql schema2.sql schema3.sql schema4.sql
Date Thu, 02 Feb 2006 19:29:23 GMT
Author: mcaisse
Date: Thu Feb  2 11:29:19 2006
New Revision: 374467

URL: http://svn.apache.org/viewcvs?rev=374467&view=rev
Log:
JDO-286

Modified:
    db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql
    db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema1.sql
    db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema2.sql
    db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema3.sql
    db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema4.sql

Modified: db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql?rev=374467&r1=374466&r2=374467&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql (original)
+++ db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema.sql Thu Feb  2 11:29:19 2006
@@ -144,7 +144,7 @@
 
 CREATE TABLE persons (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -165,7 +165,8 @@
     SALARY REAL,
     WAGE REAL,
     DISCRIMINATOR varchar(64) NOT NULL,
-    CONSTRAINT EMPS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT PERS_UK UNIQUE (PERSONID),
+    CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE insuranceplans (
@@ -181,9 +182,10 @@
 
 CREATE TABLE projects (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PROJID INTEGER UNIQUE NOT NULL,
+    PROJID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     BUDGET DECIMAL(11,2) NOT NULL,
+    CONSTRAINT PROJS_UK UNIQUE (PROJID),
     CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -3336,7 +3338,7 @@
 (
     IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE COLLECTION_OF_SIMPLE_CLASS3
@@ -3359,7 +3361,7 @@
 (
     IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE6
@@ -3382,7 +3384,7 @@
 (
     IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE COLLECTION_OF_STRING9
@@ -3580,7 +3582,7 @@
 (
     IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE LIST_OF_SIMPLE_CLASS3
@@ -3603,7 +3605,7 @@
 (
     IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE LIST_OF_SIMPLE_INTERFACE6
@@ -3626,7 +3628,7 @@
 (
     IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE LIST_OF_STRING9
@@ -3789,17 +3791,17 @@
 (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     IDENTIFIER INTEGER,
-	ARRAYLIST_OF_STRING10 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_DATE13 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_LOCALE16 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_BIG_DECIMAL19 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_BIG_INTEGER22 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_BYTE25 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_DOUBLE28 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_FLOAT31 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_INTEGER34 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_LONG37 LONG VARCHAR FOR BIT DATA,
-	ARRAYLIST_OF_SHORT40 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_STRING10 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_DATE13 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_LOCALE16 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_BIG_DECIMAL19 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_BIG_INTEGER22 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_BYTE25 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_DOUBLE28 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_FLOAT31 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_INTEGER34 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_LONG37 LONG VARCHAR FOR BIT DATA,
+    ARRAYLIST_OF_SHORT40 LONG VARCHAR FOR BIT DATA,
     CONSTRAINT ALC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -4061,7 +4063,7 @@
 (
     IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS3
@@ -4084,7 +4086,7 @@
 (
     IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE6
@@ -4107,7 +4109,7 @@
 (
     IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE LINKEDLIST_OF_STRING9
@@ -4305,7 +4307,7 @@
 (
     IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE VECTOR_OF_SIMPLE_CLASS3
@@ -4328,7 +4330,7 @@
 (
     IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE6
@@ -4351,7 +4353,7 @@
 (
     IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL,
     ALLOW_DUPLICATES BIGINT NOT NULL,
-	COLLVAL LONG VARCHAR FOR BIT DATA
+    COLLVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE VECTOR_OF_STRING9
@@ -4910,16 +4912,16 @@
 (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     IDENTIFIER INTEGER,
-	TREESET_OF_STRING10 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_DATE13 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_BIG_DECIMAL16 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_BIG_INTEGER19 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_BYTE22 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_DOUBLE25 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_FLOAT28 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_INTEGER31 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_LONG34 LONG VARCHAR FOR BIT DATA,
-	TREESET_OF_SHORT37 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_STRING10 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_DATE13 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_BIG_DECIMAL16 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_BIG_INTEGER19 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_BYTE22 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_DOUBLE25 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_FLOAT28 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_INTEGER31 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_LONG34 LONG VARCHAR FOR BIT DATA,
+    TREESET_OF_SHORT37 LONG VARCHAR FOR BIT DATA,
     CONSTRAINT TSC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -5132,20 +5134,20 @@
 (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     IDENTIFIER INTEGER,
-	MAP_OF_STRING_OBJECT86 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_STRING95 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_DATE98 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_LOCALE101 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_BYTE110 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_DOUBLE113 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_FLOAT116 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_INTEGER119 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_LONG122 LONG VARCHAR FOR BIT DATA,
-	MAP_OF_STRING_SHORT125 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_OBJECT86 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_STRING95 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_DATE98 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_LOCALE101 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_BYTE110 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_DOUBLE113 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_FLOAT116 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_INTEGER119 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_LONG122 LONG VARCHAR FOR BIT DATA,
+    MAP_OF_STRING_SHORT125 LONG VARCHAR FOR BIT DATA,
     CONSTRAINT MSKC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -5655,21 +5657,21 @@
 (
     IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS87
 (
     IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE90
 (
     IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE MAP_OF_STRING_STRING93
@@ -5755,20 +5757,20 @@
 (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     IDENTIFIER INTEGER,
-	HASHMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA,
     CONSTRAINT HMSKC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -6278,21 +6280,21 @@
 (
     IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE HASHMAP_STR_SIMPLE_CLASS87
 (
     IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE90
 (
     IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE HASHMAP_STR_STRING93
@@ -6378,20 +6380,20 @@
 (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     IDENTIFIER INTEGER,
-	HASHTBL_STR_OBJECT86 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_STRING95 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_DATE98 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_LOCALE101 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_BYTE110 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_FLOAT116 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_INTEGER119 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_LONG122 LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STR_SHORT125 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_OBJECT86 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_STRING95 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_DATE98 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_LOCALE101 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_BYTE110 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_FLOAT116 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_INTEGER119 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_LONG122 LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STR_SHORT125 LONG VARCHAR FOR BIT DATA,
     CONSTRAINT HTSKC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -6901,21 +6903,21 @@
 (
     IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE HASHTBL_STR_SIMPLE_CLASS87
 (
     IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE90
 (
     IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE HASHTBL_STR_STRING93
@@ -7004,16 +7006,16 @@
     HASHMAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA,
     HASHMAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA,
     HASHMAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_STRING35_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_DATE44_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_LONG107_STR LONG VARCHAR FOR BIT DATA,
-	HASHMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_STRING35_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_DATE44_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_LONG107_STR LONG VARCHAR FOR BIT DATA,
+    HASHMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA,
     CONSTRAINT HMSVC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -7511,16 +7513,16 @@
     HASHTBL_OBJECT8_STR LONG VARCHAR FOR BIT DATA,
     HASHTBL_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA,
     HASHTBL_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_STRING35_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_DATE44_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_BYTE71_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_LONG107_STR LONG VARCHAR FOR BIT DATA,
-	HASHTBL_SHORT116_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_STRING35_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_DATE44_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_BYTE71_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_LONG107_STR LONG VARCHAR FOR BIT DATA,
+    HASHTBL_SHORT116_STR LONG VARCHAR FOR BIT DATA,
     CONSTRAINT HTSVC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -8018,16 +8020,16 @@
     TREEMAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA,
     TREEMAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA,
     TREEMAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STRING35_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_DATE44_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_LONG107_STR LONG VARCHAR FOR BIT DATA,
-	TREEMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STRING35_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_DATE44_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_LONG107_STR LONG VARCHAR FOR BIT DATA,
+    TREEMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA,
     CONSTRAINT TMSVC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -8525,16 +8527,16 @@
     MAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA,
     MAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA,
     MAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA,
-	MAP_STRING35_STR LONG VARCHAR FOR BIT DATA,
-	MAP_DATE44_STR LONG VARCHAR FOR BIT DATA,
-	MAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
-	MAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
-	MAP_BYTE71_STR LONG VARCHAR FOR BIT DATA,
-	MAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
-	MAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
-	MAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
-	MAP_LONG107_STR LONG VARCHAR FOR BIT DATA,
-	MAP_SHORT116_STR LONG VARCHAR FOR BIT DATA,
+    MAP_STRING35_STR LONG VARCHAR FOR BIT DATA,
+    MAP_DATE44_STR LONG VARCHAR FOR BIT DATA,
+    MAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA,
+    MAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA,
+    MAP_BYTE71_STR LONG VARCHAR FOR BIT DATA,
+    MAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA,
+    MAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA,
+    MAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA,
+    MAP_LONG107_STR LONG VARCHAR FOR BIT DATA,
+    MAP_SHORT116_STR LONG VARCHAR FOR BIT DATA,
     CONSTRAINT MSVC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -9030,20 +9032,20 @@
 (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     IDENTIFIER INTEGER,
-	TREEMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA,
-	TREEMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA,
+    TREEMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA,
     CONSTRAINT TMSKC_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -9553,21 +9555,21 @@
 (
     IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE TREEMAP_STR_SIMPLE_CLASS87
 (
     IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE90
 (
     IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL,
     KEYVAL VARCHAR(100) NOT NULL,
-	VALUEVAL LONG VARCHAR FOR BIT DATA
+    VALUEVAL LONG VARCHAR FOR BIT DATA
 );
 
 CREATE TABLE TREEMAP_STR_STRING93

Modified: db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema1.sql
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema1.sql?rev=374467&r1=374466&r2=374467&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema1.sql (original)
+++ db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema1.sql Thu Feb  2 11:29:19 2006
@@ -51,13 +51,15 @@
     ID INTEGER,
     NAME VARCHAR(32) NOT NULL,
     EMP_OF_THE_MONTH INTEGER,
-    COMPANYID INTEGER REFERENCES companies,
-    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    COMPANYID INTEGER,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID)
+        REFERENCES companies (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE persons (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -68,64 +70,83 @@
     STATE CHAR(2),
     ZIPCODE CHAR(5),
     COUNTRY VARCHAR(64),
-    CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT PERS_UK UNIQUE (PERSONID)
 );
 
 CREATE TABLE employees (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     HIREDATE VARCHAR(32),
     WEEKLYHOURS DOUBLE,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES persons,
-    MENTOR INTEGER REFERENCES persons,
-    HRADVISOR INTEGER REFERENCES persons,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     CONSTRAINT EMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY)
+    CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY)
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT)
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT)
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_MANAGER FOREIGN KEY (MANAGER)
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_MENTOR FOREIGN KEY (MENTOR)
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_HRADVISOR FOREIGN KEY (HRADVISOR)
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE parttimeemployees (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     WAGE DOUBLE,
     CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY)
+    CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY)
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE fulltimeemployees (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     SALARY DOUBLE,
     CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY)
+    CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY)
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE insuranceplans (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     INSID INTEGER,
     CARRIER VARCHAR(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES persons,
-    CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    EMPLOYEE INTEGER,
+    CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT INS_EMPLOYEE FOREIGN KEY (EMPLOYEE)
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE medicalinsurance (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     PLANTYPE VARCHAR(8),
     CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT MEDINS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES insuranceplans (DATASTORE_IDENTITY)
+    CONSTRAINT MEDINS_FK FOREIGN KEY (DATASTORE_IDENTITY)
+        REFERENCES insuranceplans (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE dentalinsurance (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
     CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT DENTINS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES insuranceplans (DATASTORE_IDENTITY)
+    CONSTRAINT DENTINS_FK FOREIGN KEY (DATASTORE_IDENTITY)
+        REFERENCES insuranceplans (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE projects (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PROJID INTEGER UNIQUE NOT NULL,
+    PROJID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     BUDGET DECIMAL(11,2) NOT NULL,
-    CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT PROJS_UK UNIQUE (PROJID)
 );
 
 CREATE TABLE project_reviewer (
@@ -139,9 +160,11 @@
 );
 
 CREATE TABLE employee_phoneno_type (
-    EMPID INTEGER REFERENCES persons NOT NULL,
+    EMPID INTEGER NOT NULL,
     PHONENO VARCHAR(16) NOT NULL,
-    TYPE VARCHAR(16) NOT NULL
+    TYPE VARCHAR(16) NOT NULL,
+    CONSTRAINT employee_phoneno_type_EMPID FOREIGN KEY (EMPID)
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 ALTER TABLE project_reviewer 

Modified: db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema2.sql
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema2.sql?rev=374467&r1=374466&r2=374467&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema2.sql (original)
+++ db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema2.sql Thu Feb  2 11:29:19 2006
@@ -59,13 +59,15 @@
     ID INTEGER,
     NAME VARCHAR(32) NOT NULL,
     EMP_OF_THE_MONTH INTEGER,
-    COMPANYID INTEGER REFERENCES companies,
-    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    COMPANYID INTEGER,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) 
+        REFERENCES companies (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE persons (
     DATASTORE_IDENTITY INTEGER NOT NULL,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -76,12 +78,13 @@
     STATE CHAR(2),
     ZIPCODE CHAR(5),
     COUNTRY VARCHAR(64),
+    CONSTRAINT PERS_UK UNIQUE (PERSONID),
     CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE fulltimeemployees (
     DATASTORE_IDENTITY INTEGER NOT NULL,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -94,18 +97,29 @@
     COUNTRY VARCHAR(64),
     HIREDATE VARCHAR(32),
     WEEKLYHOURS DOUBLE,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES fulltimeemployees,
-    MENTOR INTEGER REFERENCES fulltimeemployees,
-    HRADVISOR INTEGER REFERENCES fulltimeemployees,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     SALARY DOUBLE,
-    CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT FTEMPS_UK UNIQUE (PERSONID),
+    CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_MANAGER FOREIGN KEY (MANAGER) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_MENTOR FOREIGN KEY (MENTOR) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE parttimeemployees (
     DATASTORE_IDENTITY INTEGER NOT NULL,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -118,38 +132,54 @@
     COUNTRY VARCHAR(64),
     HIREDATE VARCHAR(32),
     WEEKLYHOURS DOUBLE,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES fulltimeemployees,
-    MENTOR INTEGER REFERENCES fulltimeemployees,
-    HRADVISOR INTEGER REFERENCES fulltimeemployees,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     WAGE DOUBLE,
-    CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT PTEMPS_UK UNIQUE (PERSONID),
+    CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_MANAGER FOREIGN KEY (MANAGER) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_MENTOR FOREIGN KEY (MENTOR) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE medicalinsurance (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     INSID INTEGER,
     CARRIER VARCHAR(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES fulltimeemployees,
+    EMPLOYEE INTEGER,
     PLANTYPE VARCHAR(8),
-    CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT MEDINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE dentalinsurance (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     INSID INTEGER,
     CARRIER VARCHAR(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES fulltimeemployees,
+    EMPLOYEE INTEGER,
     LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
-    CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT DENTINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE projects (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PROJID INTEGER UNIQUE NOT NULL,
+    PROJID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     BUDGET DECIMAL(11,2) NOT NULL,
+    CONSTRAINT PROJS_UK UNIQUE (PROJID),
     CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -164,21 +194,27 @@
 );
 
 CREATE TABLE employee_phoneno_type (
-    EMPID INTEGER REFERENCES persons NOT NULL,
+    EMPID INTEGER NOT NULL,
     PHONENO VARCHAR(16) NOT NULL,
-    TYPE VARCHAR(16) NOT NULL
+    TYPE VARCHAR(16) NOT NULL,
+    CONSTRAINT EMP_PHNO_PERSONS FOREIGN KEY (EMPID) 
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE fulltime_employee_phoneno_type (
-    EMPID INTEGER REFERENCES fulltimeemployees NOT NULL,
+    EMPID INTEGER NOT NULL,
     PHONENO VARCHAR(16) NOT NULL,
-    TYPE VARCHAR(16) NOT NULL
+    TYPE VARCHAR(16) NOT NULL,
+    CONSTRAINT FTEMP_PHNO_FTEMP FOREIGN KEY (EMPID) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE parttime_employee_phoneno_type (
     EMPID INTEGER REFERENCES parttimeemployees NOT NULL,
     PHONENO VARCHAR(16) NOT NULL,
-    TYPE VARCHAR(16) NOT NULL
+    TYPE VARCHAR(16) NOT NULL,
+    CONSTRAINT PTEMP_PHNO_PTEMP FOREIGN KEY (EMPID) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY)
 );
 
 ALTER TABLE project_reviewer 

Modified: db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema3.sql
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema3.sql?rev=374467&r1=374466&r2=374467&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema3.sql (original)
+++ db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema3.sql Thu Feb  2 11:29:19 2006
@@ -52,13 +52,15 @@
     ID INTEGER,
     NAME VARCHAR(32) NOT NULL,
     EMP_OF_THE_MONTH INTEGER,
-    COMPANYID INTEGER REFERENCES companies,
-    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    COMPANYID INTEGER,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) 
+        REFERENCES companies (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE persons (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -69,6 +71,7 @@
     STATE CHAR(2),
     ZIPCODE CHAR(5),
     COUNTRY VARCHAR(64),
+    CONSTRAINT PERS_UK UNIQUE (PERSONID),
     CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -76,14 +79,25 @@
     DATASTORE_IDENTITY INTEGER NOT NULL,
     HIREDATE VARCHAR(32),
     WEEKLYHOURS DOUBLE,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES persons,
-    MENTOR INTEGER REFERENCES persons,
-    HRADVISOR INTEGER REFERENCES persons,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     WAGE DOUBLE,
     CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons 
+    CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) 
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_MANAGER FOREIGN KEY (MANAGER) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_MENTOR FOREIGN KEY (MENTOR) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT PTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) 
+        REFERENCES parttimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE fulltimeemployees (
@@ -97,32 +111,48 @@
     HRADVISOR INTEGER REFERENCES persons,
     SALARY DOUBLE,
     CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons 
+    CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) 
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_MANAGER FOREIGN KEY (MANAGER) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_MENTOR FOREIGN KEY (MENTOR) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY),
+    CONSTRAINT FTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE medicalinsurance (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     INSID INTEGER,
     CARRIER VARCHAR(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES persons,
+    EMPLOYEE INTEGER,
     PLANTYPE VARCHAR(8),
-    CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT MEDINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE dentalinsurance (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     INSID INTEGER,
     CARRIER VARCHAR(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES persons,
+    EMPLOYEE INTEGER,
     LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
-    CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT DENTINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) 
+        REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE projects (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PROJID INTEGER UNIQUE NOT NULL,
+    PROJID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     BUDGET DECIMAL(11,2) NOT NULL,
+    CONSTRAINT PROJS_UK UNIQUE (PROJID),
     CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY)
 );
 
@@ -137,9 +167,11 @@
 );
 
 CREATE TABLE employee_phoneno_type (
-    EMPID INTEGER REFERENCES persons NOT NULL,
+    EMPID INTEGER NOT NULL,
     PHONENO VARCHAR(16) NOT NULL,
-    TYPE VARCHAR(16) NOT NULL
+    TYPE VARCHAR(16) NOT NULL,
+    CONSTRAINT EMP_PHNO_PERSONS FOREIGN KEY (EMPID) 
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 ALTER TABLE project_reviewer 

Modified: db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema4.sql
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema4.sql?rev=374467&r1=374466&r2=374467&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema4.sql (original)
+++ db/jdo/trunk/tck20/src/sql/derby/datastoreidentity/schema4.sql Thu Feb  2 11:29:19 2006
@@ -47,13 +47,15 @@
     ID INTEGER,
     NAME VARCHAR(32) NOT NULL,
     EMP_OF_THE_MONTH INTEGER,
-    COMPANYID INTEGER REFERENCES companies,
-    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    COMPANYID INTEGER,
+    CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) 
+        REFERENCES companies (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE persons (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PERSONID INTEGER UNIQUE NOT NULL,
+    PERSONID INTEGER NOT NULL,
     FIRSTNAME VARCHAR(32) NOT NULL,
     LASTNAME VARCHAR(32) NOT NULL,
     MIDDLENAME VARCHAR(32),
@@ -64,42 +66,57 @@
     STATE CHAR(2),
     ZIPCODE CHAR(5),
     COUNTRY VARCHAR(64),
-    CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT PERS_UK UNIQUE (PERSONID)
 );
 
 CREATE TABLE employees (
     DATASTORE_IDENTITY INTEGER NOT NULL,
     HIREDATE VARCHAR(32),
     WEEKLYHOURS DOUBLE,
-    DEPARTMENT INTEGER REFERENCES departments,
-    FUNDINGDEPT INTEGER REFERENCES departments,
-    MANAGER INTEGER REFERENCES persons,
-    MENTOR INTEGER REFERENCES persons,
-    HRADVISOR INTEGER REFERENCES persons,
+    DEPARTMENT INTEGER,
+    FUNDINGDEPT INTEGER,
+    MANAGER INTEGER,
+    MENTOR INTEGER,
+    HRADVISOR INTEGER,
     WAGE DOUBLE,
     SALARY DOUBLE,
     DISCRIMINATOR varchar(64) NOT NULL,
     CONSTRAINT EMPS_PK PRIMARY KEY (DATASTORE_IDENTITY),
-    CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons
+    CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) 
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) 
+        REFERENCES departments (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_MANAGER FOREIGN KEY (MANAGER) 
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_MENTOR FOREIGN KEY (MENTOR) 
+        REFERENCES persons (DATASTORE_IDENTITY),
+    CONSTRAINT EMPS_HRADVISOR FOREIGN KEY (HRADVISOR) 
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE insuranceplans (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
     INSID INTEGER,
     CARRIER VARCHAR(64) NOT NULL,
-    EMPLOYEE INTEGER REFERENCES persons,
+    EMPLOYEE INTEGER,
     PLANTYPE VARCHAR(8),
     LIFETIME_ORTHO_BENEFIT DECIMAL(22,3),
     DISCRIMINATOR varchar(64) NOT NULL,
-    CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT INS_EMPLOYEE FOREIGN KEY (EMPLOYEE) 
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 CREATE TABLE projects (
     DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
-    PROJID INTEGER UNIQUE NOT NULL,
+    PROJID INTEGER NOT NULL,
     NAME VARCHAR(32) NOT NULL,
     BUDGET DECIMAL(11,2) NOT NULL,
-    CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY)
+    CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY),
+    CONSTRAINT PROJS_UK UNIQUE (PROJID)
 );
 
 CREATE TABLE project_reviewer (
@@ -113,9 +130,11 @@
 );
 
 CREATE TABLE employee_phoneno_type (
-    EMPID INTEGER REFERENCES persons NOT NULL,
+    EMPID INTEGER NOT NULL,
     PHONENO VARCHAR(16) NOT NULL,
-    TYPE VARCHAR(16) NOT NULL
+    TYPE VARCHAR(16) NOT NULL,
+    CONSTRAINT employee_phoneno_type_EMPID FOREIGN KEY (EMPID) 
+        REFERENCES persons (DATASTORE_IDENTITY)
 );
 
 ALTER TABLE project_reviewer 



Mime
View raw message