Index: test/sql/derby/schema1.sql =================================================================== --- test/sql/derby/schema1.sql (revision 164335) +++ test/sql/derby/schema1.sql (working copy) @@ -6,9 +6,9 @@ -- mylib ------------------------- +DROP TABLE PCRect; DROP TABLE PCPoint; DROP TABLE PCPoint2; -DROP TABLE PCRect; DROP TABLE PrimitiveTypes; CREATE TABLE PCPoint ( @@ -27,8 +27,8 @@ CREATE TABLE PCRect ( ID BIGINT NOT NULL, - UPPER_LEFT BIGINT NOT NULL, - LOWER_RIGHT BIGINT NOT NULL, + UPPER_LEFT BIGINT NOT NULL references PCPoint, + LOWER_RIGHT BIGINT NOT NULL references PCPoint, CONSTRAINT PCRCT_CONST PRIMARY KEY (ID) ); @@ -66,19 +66,31 @@ DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; +ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; +DROP TABLE address; +CREATE TABLE address ( + ADDRESS_ID DECIMAL(19) NOT NULL, + STREET VARCHAR(64), + CITY VARCHAR(64), + STATE VARCHAR(2), + ZIPCODE VARCHAR(5), + COUNTRY VARCHAR(64), + CONSTRAINT ADDRESS_PK PRIMARY KEY(ADDRESS_ID) +); + CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, - FOUNDEDDATE VARCHAR(32) NOT NULL, + FOUNDED_DATE DATE NOT NULL, STREET VARCHAR(64), CITY VARCHAR(64), - STATE CHAR(2), - ZIPCODE CHAR(5), + STATE VARCHAR(2), + ZIPCODE VARCHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); @@ -96,16 +108,16 @@ FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), - BIRTHDATE VARCHAR(32) NOT NULL, + BIRTHDATE DATE NOT NULL, STREET VARCHAR(64), CITY VARCHAR(64), - STATE CHAR(2), - ZIPCODE CHAR(5), + STATE VARCHAR(2), + ZIPCODE VARCHAR(5), COUNTRY VARCHAR(64), - HIREDATE VARCHAR(32), + HIREDATE DATE, WEEKLYHOURS FLOAT, DEPARTMENT INTEGER REFERENCES departments, - FUNDINGDEPT INTEGER REFERENCES departments, + FUNDING_DEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, @@ -118,8 +130,8 @@ CREATE TABLE insuranceplans ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, - LIFETIME_ORTHO_BENEFIT DECIMAL, - PLANTYPE VARCHAR(8), + LIFETIME_ORTHO_BENEFIT DECIMAL(19), + PLAN_TYPE VARCHAR(8), DISCRIMINATOR varchar(64) NOT NULL, EMPLOYEE INTEGER REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (INSID) @@ -128,24 +140,28 @@ CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, - BUDGET DECIMAL NOT NULL, + BUDGET DECIMAL(19) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER REFERENCES projects NOT NULL, - REVIEWER INTEGER REFERENCES persons NOT NULL + REVIEWER INTEGER REFERENCES persons NOT NULL, + CONSTRAINT PROJ_REVIEWER_PK PRIMARY KEY (PROJID, REVIEWER) ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, - MEMBER INTEGER REFERENCES persons NOT NULL + MEMBER INTEGER REFERENCES persons NOT NULL, + CONSTRAINT PROJ_MEMBER_PK PRIMARY KEY (PROJID, MEMBER) ); CREATE TABLE employee_phoneno_type ( - EMPID INTEGER REFERENCES persons NOT NULL, + PERSONID INTEGER REFERENCES persons NOT NULL, + ADPT_PK_IDX INTEGER NOT NULL, PHONENO VARCHAR(16) NOT NULL, - TYPE VARCHAR(16) NOT NULL + TYPE VARCHAR(16) NOT NULL, + CONSTRAINT PK PRIMARY KEY (PERSONID, ADPT_PK_IDX) ); ALTER TABLE departments Index: test/sql/derby/schema2.sql =================================================================== --- test/sql/derby/schema2.sql (revision 164335) +++ test/sql/derby/schema2.sql (working copy) @@ -6,9 +6,9 @@ -- mylib ------------------------- +DROP TABLE PCRect; DROP TABLE PCPoint; DROP TABLE PCPoint2; -DROP TABLE PCRect; DROP TABLE PrimitiveTypes; CREATE TABLE PCPoint ( @@ -27,8 +27,8 @@ CREATE TABLE PCRect ( ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, - UPPER_LEFT BIGINT NOT NULL, - LOWER_RIGHT BIGINT NOT NULL, + UPPER_LEFT BIGINT NOT NULL references PCPoint, + LOWER_RIGHT BIGINT NOT NULL references PCPoint, CONSTRAINT PCRCT_CONST PRIMARY KEY (ID) ); @@ -66,6 +66,7 @@ DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; +ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; @@ -74,7 +75,7 @@ CREATE TABLE companies ( ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, NAME VARCHAR(32) NOT NULL, - FOUNDEDDATE VARCHAR(32) NOT NULL, + FOUNDED_DATE VARCHAR(32) NOT NULL, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), @@ -105,7 +106,7 @@ HIREDATE VARCHAR(32), WEEKLYHOURS FLOAT, DEPARTMENT INTEGER REFERENCES departments, - FUNDINGdEPT INTEGER REFERENCES departments, + FUNDING_DEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, @@ -119,7 +120,7 @@ INSID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, CARRIER VARCHAR(64) NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL, - PLANtYPE VARCHAR(8), + PLAN_TYPE VARCHAR(8), DISCRIMINATOR VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (INSID) Index: test/java/org/apache/jdo/tck/pc/company/Company.java =================================================================== --- test/java/org/apache/jdo/tck/pc/company/Company.java (revision 164307) +++ test/java/org/apache/jdo/tck/pc/company/Company.java (working copy) @@ -31,7 +31,7 @@ /** * This class represents information about a company. */ -public class Company +public class Company extends AbstractCompany implements Serializable, Comparable, DeepEquality, ICompany { private long companyid; @@ -167,78 +167,7 @@ departments = new HashSet(); } - /** - * Returns true if all the fields of this instance are - * deep equal to the coresponding fields of the specified Person. - * @param other the object with which to compare. - * @param helper EqualityHelper to keep track of instances that have - * already been processed. - * @return true if all the fields are deep equal; - * false otherwise. - * @throws ClassCastException if the specified instances' type prevents - * it from being compared to this instance. - */ - public boolean deepCompareFields(DeepEquality other, - EqualityHelper helper) { - ICompany otherCompany = (ICompany)other; - return (companyid == otherCompany.getCompanyid()) && - helper.equals(name, otherCompany.getName()) && - helper.equals(founded, otherCompany.getFounded()) && - helper.deepEquals(address, otherCompany.getAddress()) && - helper.deepEquals(departments, otherCompany.getDepartments()); - } - - /** - * Compares this object with the specified object for order. Returns a - * negative integer, zero, or a positive integer as this object is less - * than, equal to, or greater than the specified object. - * @param o The Object to be compared. - * @return a negative integer, zero, or a positive integer as this - * object is less than, equal to, or greater than the specified object. - * @throws ClassCastException - if the specified object's type prevents - * it from being compared to this Object. - */ - public int compareTo(Object o) { - return compareTo((ICompany)o); - } - - /** - * Compares this object with the specified Company object for - * order. Returns a negative integer, zero, or a positive integer as - * this object is less than, equal to, or greater than the specified - * object. - * @param other The Company object to be compared. - * @return a negative integer, zero, or a positive integer as this - * object is less than, equal to, or greater than the specified Company - * object. - */ - public int compareTo(ICompany other) { - long otherId = other.getCompanyid(); - return (companyid < otherId ? -1 : (companyid == otherId ? 0 : 1)); - } - - /** - * Indicates whether some other object is "equal to" this one. - * @param obj the object with which to compare. - * @return true if this object is the same as the obj - * argument; false otherwise. - */ - public boolean equals(Object obj) { - if (obj instanceof ICompany) { - return compareTo((ICompany)obj) == 0; - } - return false; - } - /** - * Returns a hash code value for the object. - * @return a hash code value for this object. - */ - public int hashCode() { - return (int)companyid; - } - - /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. Index: test/java/org/apache/jdo/tck/extents/ExtentTest.java =================================================================== --- test/java/org/apache/jdo/tck/extents/ExtentTest.java (revision 164331) +++ test/java/org/apache/jdo/tck/extents/ExtentTest.java (working copy) @@ -65,10 +65,12 @@ /** */ protected void checkPM() { try { - beginTransaction(); + /** Don't use beginTransaction() because this calls getPM() + * which calls checkPM()! */ + pm.currentTransaction().begin(); Extent ex = getPM().getExtent(Company.class, false); int count = countIterator(ex.iterator()); - commitTransaction(); + pm.currentTransaction().commit(); if (count == 1) { if (debug) logger.debug ("Found company"); return; Index: test/conf/derby.properties =================================================================== --- test/conf/derby.properties (revision 164307) +++ test/conf/derby.properties (working copy) @@ -1,2 +1,2 @@ # This flag must be set on Mac OSX -#derby.storage.fileSyncTransactionLog=true +derby.storage.fileSyncTransactionLog=true Index: test/conf/jdori.properties =================================================================== --- test/conf/jdori.properties (revision 164307) +++ test/conf/jdori.properties (working copy) @@ -13,10 +13,10 @@ javax.jdo.option.RestoreValues=false javax.jdo.option.Mapping=derby -#org.jpox.validateTables=false # default = true +#org.jpox.validateTables=false # default = true org.jpox.validateConstraints=false org.jpox.autoCreateSchema=false -org.jpox.autoCreateTables=false +org.jpox.autoCreateTables=true org.jpox.autoCreateConstraints=false org.jpox.autoCreateColumns=false org.jpox.rdbms.CheckExistTablesOrViews=false Index: test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm =================================================================== --- test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm (revision 164307) +++ test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby.orm (working copy) @@ -18,7 +18,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -119,7 +119,7 @@ - + Index: test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm =================================================================== --- test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm (revision 164307) +++ test/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-derby.orm (working copy) @@ -7,25 +7,25 @@ - - - - - - + + + + + + - - + + - - - - - + + + + + @@ -33,7 +33,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -80,35 +80,35 @@ - + - - - - + + + + - - - - - - + + + + + + - - + + - + - - + + @@ -120,12 +120,12 @@ - + - + Index: maven.xml =================================================================== --- maven.xml (revision 164307) +++ maven.xml (working copy) @@ -386,7 +386,6 @@ -