db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r552622 [2/5] - in /db/jdo/trunk/tck2: ./ src/conf/ src/java/org/apache/jdo/tck/pc/company/ src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/ src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/
Date Mon, 02 Jul 2007 23:09:48 GMT
Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.math.BigDecimal;
+
+import org.apache.jdo.tck.pc.company.IDentalInsurance;
+import org.apache.jdo.tck.pc.company.IEmployee;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a dental insurance carrier selection for a
+ * particular <code>Employee</code>.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IDentalInsurance")
+public class FCDentalInsurance extends FCInsurance implements IDentalInsurance {
+
+    @Column(name="LIFETIME_ORTHO_BENEFIT")
+    private BigDecimal lifetimeOrthoBenefit;
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public FCDentalInsurance() {}
+
+    /**
+     * Construct a <code>DentalInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit.
+     */
+    public FCDentalInsurance(long insid, String carrier, 
+                           BigDecimal lifetimeOrthoBenefit) {
+        super(insid, carrier);
+        this.lifetimeOrthoBenefit = lifetimeOrthoBenefit;
+    }
+
+    /**
+     * Construct a <code>FCDentalInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     * @param employee The employee associated with this insurance.
+     * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit.
+     */
+    public FCDentalInsurance(long insid, String carrier, IEmployee employee,
+                           BigDecimal lifetimeOrthoBenefit) {
+        super(insid, carrier, employee);
+        this.lifetimeOrthoBenefit = lifetimeOrthoBenefit;
+    }
+
+    /**
+     * Get the insurance lifetimeOrthoBenefit.
+     * @return The insurance lifetimeOrthoBenefit.
+     */
+    public BigDecimal getLifetimeOrthoBenefit() {
+        return lifetimeOrthoBenefit;
+    }
+
+    /**
+     * Set the insurance lifetimeOrthoBenefit.
+     * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit.
+     */
+    public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) {
+        this.lifetimeOrthoBenefit = lifetimeOrthoBenefit;
+    }
+
+    /**
+     * Returns a String representation of a <code>FCDentalInsurance</code>
+     * object.
+     * @return a String representation of a <code>FCDentalInsurance</code>
+     * object.
+     */
+    public String toString() {
+        return "FCDentalInsurance(" + getFieldRepr()+ ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    protected String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(super.getFieldRepr());
+        rc.append(", lifetimeOrthoBenefit ").append(lifetimeOrthoBenefit);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the other Object.
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IDentalInsurance otherIns = (IDentalInsurance)other;
+        String where = "FCDentalInsurance<" + getInsid() + ">";
+        return super.deepCompareFields(otherIns, helper) &
+            helper.equals(lifetimeOrthoBenefit, 
+                          otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit");
+    }
+
+}
+

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,433 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.IOException;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jdo.tck.pc.company.ICompany;
+import org.apache.jdo.tck.pc.company.IDepartment;
+import org.apache.jdo.tck.pc.company.IEmployee;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a department within a company.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IDepartment")
+@Table(table="departments")
+@Inheritance(strategy=InheritanceStrategy.NEW_TABLE)
+@Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME,
+        column="DISCRIMINATOR")
+public class FCDepartment
+    implements IDepartment, Serializable, Comparable, Comparator, DeepEquality {
+
+    public static final int RECOMMENDED_NO_OF_EMPS = 2;
+
+    @Field(primaryKey="true")
+    @Column(name="ID")
+    private long deptid;
+    @Column(name="NAME")
+    private String  name;
+    @Column(name="COMPANYID")
+    private FCCompany company;
+    @Column(name="EMP_OF_THE_MONTH")
+    private FCEmployee employeeOfTheMonth;
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT, 
+            mappedBy="department")
+    @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCEmployee.class)
+    private transient Set employees = new HashSet();
+    @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCEmployee.class)
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,
+            mappedBy="fundingDept")
+    private transient Set fundedEmps = new HashSet();
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public FCDepartment() {}
+
+    /**
+     * Construct a <code>Department</code> instance.
+     * @param deptid The department id.
+     * @param name The name of the department.
+     */
+    public FCDepartment(long deptid, String name) {
+        this.deptid = deptid;
+        this.name = name;
+    }
+
+    /**
+     * Construct a <code>Department</code> instance.
+     * @param deptid The department id.
+     * @param name The name of the department.
+     * @param company The company that the department is associated with. 
+     */
+    public FCDepartment(long deptid, String name, ICompany company) {
+        this.deptid = deptid;
+        this.name = name;
+        this.company = (FCCompany)company;
+    }
+
+    /**
+     * Construct a <code>Department</code> instance.
+     * @param deptid The department id.
+     * @param name The name of the department.
+     * @param company The company that the department is associated with.
+     * @param employeeOfTheMonth The employee of the month the
+     * department is associated with.
+     */
+    public FCDepartment(long deptid, String name, ICompany company, 
+                      IEmployee employeeOfTheMonth) {
+        this.deptid = deptid;
+        this.name = name;
+        this.company = (FCCompany)company;
+        this.employeeOfTheMonth = (FCEmployee)employeeOfTheMonth;
+    }
+
+    /**
+     * Set the id associated with this object.
+     * @param id the id.
+     */
+    public void setDeptid(long id) {
+        if (this.deptid != 0)
+            throw new IllegalStateException("Id is already set.");
+        this.deptid = id;
+    }
+
+    /**
+     * Get the department id.
+     * @return The department id.
+     */
+    public long getDeptid() {
+        return deptid;
+    }
+
+    /**
+     * Get the name of the department.
+     * @return The name of the department.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Set the name of the department.
+     * @param name The name to set for the department.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Get the company associated with the department.
+     * @return The company.
+     */
+    public ICompany getCompany() {
+        return company;
+    }
+
+    /**
+     * Set the company for the department.
+     * @param company The company to associate with the department.
+     */
+    public void setCompany(ICompany company) {
+        this.company = (FCCompany)company;
+    }
+
+    /**
+     * Get the employee of the month associated with the department.
+     * @return The employee of the month.
+     */
+    public IEmployee getEmployeeOfTheMonth() {
+        return employeeOfTheMonth;
+    }
+
+    /**
+     * Set the employee of the month for the department.
+     * @param employeeOfTheMonth The employee of the month to
+     * associate with the department. 
+     */
+    public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) {
+        this.employeeOfTheMonth = (FCEmployee)employeeOfTheMonth;
+    }
+
+    /**
+     * Get the employees in the department as an unmodifiable set.
+     * @return The set of employees in the department, as an unmodifiable
+     * set. 
+     */
+    public Set getEmployees() {
+        return Collections.unmodifiableSet(employees);
+    }
+
+    /**
+     * Add an employee to the department.
+     * @param emp The employee to add to the department.
+     */
+    public void addEmployee(FCEmployee emp) {
+        employees.add(emp);
+    }
+
+    /**
+     * Remove an employee from the department.
+     * @param emp The employee to remove from the department.
+     */
+    public void removeEmployee(FCEmployee emp) {
+        employees.remove(emp);
+    }
+
+    /**
+     * Set the employees to be in this department.
+     * @param employees The set of employees for this department.
+     */
+    public void setEmployees(Set employees) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.employees = (employees != null) ? new HashSet(employees) : null;
+    }
+
+    /**
+     * Get the funded employees in the department as an unmodifiable set.
+     * @return The set of funded employees in the department, as an
+     * unmodifiable set. 
+     */
+    public Set getFundedEmps() {
+        return Collections.unmodifiableSet(fundedEmps);
+    }
+
+    /**
+     * Add an employee to the collection of funded employees of this
+     * department. 
+     * @param emp The employee to add to the department.
+     */
+    public void addFundedEmp(FCEmployee emp) {
+        fundedEmps.add(emp);
+    }
+
+    /**
+     * Remove an employee from collection of funded employees of this
+     * department. 
+     * @param emp The employee to remove from the department.
+     */
+    public void removeFundedEmp(FCEmployee emp) {
+        fundedEmps.remove(emp);
+    }
+
+    /**
+     * Set the funded employees to be in this department.
+     * @param employees The set of funded employees for this department. 
+     */
+    public void setFundedEmps(Set employees) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.fundedEmps = (fundedEmps != null) ? new HashSet(employees) : null;
+    }
+
+    /** Serialization support: initialize transient fields. */
+    private void readObject(ObjectInputStream in)
+        throws IOException, ClassNotFoundException {
+        in.defaultReadObject();
+        employees = new HashSet();
+        fundedEmps = new HashSet();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the other FCDepartment.
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IDepartment otherDept = (IDepartment)other;
+        String where = "FCDepartment<" + deptid + ">";
+        return 
+            helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & 
+            helper.equals(name, otherDept.getName(), where + ".name") &
+            helper.deepEquals(company, otherDept.getCompany(), where + ".company") &
+            helper.deepEquals(employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") &
+            helper.deepEquals(employees, otherDept.getEmployees(), where + ".employees") &
+            helper.deepEquals(fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps");
+    }
+    
+    /**
+     * Returns a String representation of a <code>FCDepartment</code> object.
+     * @return a String representation of a <code>FCDepartment</code> object.
+     */
+    public String toString() {
+        return "FCDepartment(" + getFieldRepr()+ ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    protected String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(deptid);
+        rc.append(", name ").append(name);
+        return rc.toString();
+    }
+
+    /** 
+     * 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((IDepartment)o);
+    }
+
+    /** 
+     * Compare two instances. This is a method in Comparator.
+     */
+    public int compare(Object o1, Object o2) {
+        return compare((IDepartment)o1, (IDepartment)o2);
+    }
+
+    /** 
+     * Compares this object with the specified Department 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 Department 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
+     * Department object. 
+     */
+    public int compareTo(IDepartment other) {
+        return compare(this, other);
+    }
+
+    /**
+     * Compares its two IDepartment arguments for order. Returns a negative
+     * integer, zero, or a positive integer as the first argument is less
+     * than, equal to, or greater than the second. 
+     * @param o1 the first IDepartment object to be compared. 
+     * @param o2 the second IDepartment object to be compared. 
+     * @return a negative integer, zero, or a positive integer as the first
+     * object is less than, equal to, or greater than the second object. 
+     */
+    public static int compare(IDepartment o1, IDepartment o2) {
+        return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid());
+    }
+    
+    /** 
+     * Indicates whether some other object is "equal to" this one.
+     * @param obj the object with which to compare.
+     * @return <code>true</code> if this object is the same as the obj
+     * argument; <code>false</code> otherwise. 
+     */
+    public boolean equals(Object obj) {
+        if (obj instanceof IDepartment) {
+            return compareTo((IDepartment)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)deptid;
+    }
+
+    /**
+     * The application identity class associated with the
+     * <code>Department</code> class. 
+     */
+    public static class Oid implements Serializable, Comparable {
+
+        /**
+         * This field represents the application identifier field 
+         * for the <code>Department</code> class. 
+         * It must match in name and type with the field in the
+         * <code>Department</code> class. 
+         */
+        public long deptid;
+
+        /**
+         * The required public, no-arg constructor.
+         */
+        public Oid() { }
+
+        /**
+         * A constructor to initialize the identifier field.
+         * @param deptid the deptid of the Department.
+         */
+        public Oid(long deptid) {
+            this.deptid = deptid;
+        }
+        
+        public Oid(String s) { deptid = Long.parseLong(justTheId(s)); }
+
+        public String toString() { return this.getClass().getName() + ": "  + deptid;}
+
+
+        /** */
+        public boolean equals(java.lang.Object obj) {
+            if( obj==null || !this.getClass().equals(obj.getClass()) )
+                return( false );
+            Oid o = (Oid) obj;
+            if( this.deptid != o.deptid ) return( false );
+            return( true );
+        }
+
+        /** */
+        public int hashCode() {
+            return( (int) deptid );
+        }
+        
+        protected static String justTheId(String str) {
+            return str.substring(str.indexOf(':') + 1);
+        }
+
+        /** */
+        public int compareTo(Object obj) {
+            // may throw ClassCastException which the user must handle
+            Oid other = (Oid) obj;
+            if( deptid < other.deptid ) return -1;
+            if( deptid > other.deptid ) return 1;
+            return 0;
+        }
+
+    }
+
+}
+

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,498 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.io.ObjectInputStream;
+import java.io.IOException;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jdo.tck.pc.company.IAddress;
+import org.apache.jdo.tck.pc.company.IDentalInsurance;
+import org.apache.jdo.tck.pc.company.IDepartment;
+import org.apache.jdo.tck.pc.company.IEmployee;
+import org.apache.jdo.tck.pc.company.IMedicalInsurance;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents an employee.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IEmployee")
+@Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE)
+public abstract class FCEmployee extends FCPerson implements IEmployee {
+
+    @Column(name="HIREDATE")
+    private Date             hiredate;
+    @Column(name="WEEKLYHOURS")
+    private double           weeklyhours;
+    @Field(mappedBy="employee")
+    private FCDentalInsurance  dentalInsurance;
+    @Field(mappedBy="employee")
+    private FCMedicalInsurance medicalInsurance;
+    @Column(name="DEPARTMENT")
+    private FCDepartment       department;
+    @Column(name="FUNDINGDEPT")
+    private FCDepartment       fundingDept;
+    @Column(name="MANAGER")
+    private FCEmployee         manager;
+    @Column(name="MENTOR")
+    private FCEmployee         mentor;
+    @Field(mappedBy="mentor")
+    private FCEmployee         protege;
+    @Column(name="HRADVISOR")
+    private FCEmployee         hradvisor;
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,
+            mappedBy="reviewers")
+    @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCProject.class)
+    private transient Set reviewedProjects = new HashSet();
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,
+            mappedBy="members")
+    @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCProject.class)
+    private transient Set projects = new HashSet();
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,
+            mappedBy="manager")
+    @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCEmployee.class)
+    private transient Set team = new HashSet();
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,
+            mappedBy="hradvisors")
+    @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCEmployee.class)
+    private transient Set hradvisees = new HashSet();
+
+    /** This is the JDO-required no-args constructor */
+    protected FCEmployee() {}
+
+    /**
+     * Construct an <code>FCEmployee</code> instance.
+     * @param personid The identifier for the person.
+     * @param firstname The first name of the employee.
+     * @param lastname The last name of the employee.
+     * @param middlename The middle name of the employee.
+     * @param birthdate The birth date of the employee.
+     * @param hiredate The date that the employee was hired.
+     */
+    public FCEmployee(long personid, String firstname, String lastname, 
+                    String middlename, Date birthdate,
+                    Date hiredate) {
+        super(personid, firstname, lastname, middlename, birthdate);
+        this.hiredate = hiredate;
+    }
+
+    /**
+     * Construct an <code>FCEmployee</code> instance.
+     * @param personid The identifier for the person.
+     * @param firstname The first name of the employee.
+     * @param lastname The last name of the employee.
+     * @param middlename The middle name of the employee.
+     * @param birthdate The birth date of the employee.
+     * @param address The address of the employee.
+     * @param hiredate The date that the employee was hired.
+     */
+    public FCEmployee(long personid, String firstname, String lastname, 
+                    String middlename, Date birthdate, IAddress address,
+                    Date hiredate) {
+        super(personid, firstname, lastname, middlename, birthdate, address);
+        this.hiredate = hiredate;
+    }
+
+    /**
+     * Get the date that the employee was hired.
+     * @return The date the employee was hired.
+     */
+    public Date getHiredate() {
+        return hiredate;
+    }
+
+    /**
+     * Set the date that the employee was hired.
+     * @param hiredate The date the employee was hired.
+     */
+    public void setHiredate(Date hiredate) {
+        this.hiredate = hiredate;
+    }
+
+    /**
+     * Get the weekly hours of the employee.
+     * @return The number of hours per week that the employee works.
+     */
+    public double getWeeklyhours() {
+        return weeklyhours;
+    }
+
+    /**
+     * Set the number of hours per week that the employee works.
+     * @param weeklyhours The number of hours per week that the employee
+     * works. 
+     */
+    public void setWeeklyhours(double weeklyhours) {
+        this.weeklyhours = weeklyhours;
+    }
+
+    /**
+     * Get the reviewed projects.
+     * @return The reviewed projects as an unmodifiable set.
+     */
+    public Set getReviewedProjects() {
+        return Collections.unmodifiableSet(reviewedProjects);
+    }
+
+    /**
+     * Add a reviewed project.
+     * @param project A reviewed project.
+     */
+    public void addReviewedProjects(FCProject project) {
+        reviewedProjects.add(project);
+    }
+
+    /**
+     * Remove a reviewed project.
+     * @param project A reviewed project.
+     */
+    public void removeReviewedProject(FCProject project) {
+        reviewedProjects.remove(project);
+    }
+
+    /**
+     * Set the reviewed projects for the employee.
+     * @param reviewedProjects The set of reviewed projects.
+     */
+    public void setReviewedProjects(Set reviewedProjects) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.reviewedProjects = 
+            (reviewedProjects != null) ? new HashSet(reviewedProjects) : null;
+    }
+
+    /**
+     * Get the employee's projects.
+     * @return The employee's projects are returned as an unmodifiable
+     * set. 
+     */
+    public Set getProjects() {
+        return Collections.unmodifiableSet(projects);
+    }
+
+    /**
+     * Add a project for the employee.
+     * @param project The project.
+     */
+    public void addProject(FCProject project) {
+        projects.add(project);
+    }
+
+    /**
+     * Remove a project from an employee's set of projects.
+     * @param project The project.
+     */
+    public void removeProject(FCProject project) {
+        projects.remove(project);
+    }
+
+    /**
+     * Set the projects for the employee.
+     * @param projects The set of projects of the employee.
+     */
+    public void setProjects(Set projects) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.projects = (projects != null) ? new HashSet(projects) : null;
+    }
+    
+    /**
+     * Get the dental insurance of the employee.
+     * @return The employee's dental insurance.
+     */
+    public IDentalInsurance getDentalInsurance() {
+        return dentalInsurance;
+    }
+
+    /**
+     * Set the dental insurance object for the employee.
+     * @param dentalInsurance The dental insurance object to associate with
+     * the employee. 
+     */
+    public void setDentalInsurance(IDentalInsurance dentalInsurance) {
+        this.dentalInsurance = (FCDentalInsurance)dentalInsurance;
+    }
+    /**
+     * Get the medical insurance of the employee.
+     * @return The employee's medical insurance.
+     */
+    public IMedicalInsurance getMedicalInsurance() {
+        return medicalInsurance;
+    }
+
+    /**
+     * Set the medical insurance object for the employee.
+     * @param medicalInsurance The medical insurance object to associate
+     * with the employee. 
+     */
+    public void setMedicalInsurance(IMedicalInsurance medicalInsurance) {
+        this.medicalInsurance = (FCMedicalInsurance)medicalInsurance;
+    }
+
+    /**
+     * Get the employee's department.
+     * @return The department associated with the employee.
+     */
+    public IDepartment getDepartment() {
+        return (IDepartment)department;
+    }
+
+    /**
+     * Set the employee's department.
+     * @param department The department.
+     */
+    public void setDepartment(IDepartment department) {
+        this.department = (FCDepartment)department;
+    }
+
+    /**
+     * Get the employee's funding department.
+     * @return The funding department associated with the employee.
+     */
+    public IDepartment getFundingDept() {
+        return (IDepartment)fundingDept;
+    }
+
+    /**
+     * Set the employee's funding department.
+     * @param department The funding department.
+     */
+    public void setFundingDept(IDepartment department) {
+        this.fundingDept = (FCDepartment)department;
+    }
+
+    /**
+     * Get the employee's manager.
+     * @return The employee's manager.
+     */
+    public IEmployee getManager() {
+        return manager;
+    }
+
+    /**
+     * Set the employee's manager.
+     * @param manager The employee's manager.
+     */
+    public void setManager(IEmployee manager) {
+        this.manager = (FCEmployee)manager;
+    }
+
+    /**
+     * Get the employee's team.
+     * @return The set of <code>FCEmployee</code>s on this employee's team,
+     * returned as an unmodifiable set. 
+     */
+    public Set getTeam() {
+        return Collections.unmodifiableSet(team);
+    }
+
+    /**
+     * Add an <code>FCEmployee</code> to this employee's team.
+     * This method sets both sides of the relationship, modifying
+     * this employees team to include parameter emp and modifying
+     * emp to set its manager attribute to this object.
+     * @param emp The <code>FCEmployee</code> to add to the team.
+     */
+    public void addToTeam(FCEmployee emp) {
+        team.add(emp);
+        emp.manager = this;
+    }
+
+    /**
+     * Remove an <code>FCEmployee</code> from this employee's team.
+     * This method will also set the <code>emp</code> manager to null.
+     * @param emp The <code>FCEmployee</code> to remove from the team.
+     */
+    public void removeFromTeam(FCEmployee emp) {
+        team.remove(emp);
+        emp.manager = null;
+    }
+
+    /**
+     * Set the employee's team.
+     * @param team The set of <code>FCEmployee</code>s.
+     */
+    public void setTeam(Set team) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.team = (team != null) ? new HashSet(team) : null;
+    }
+
+    /**
+     * Set the mentor for this employee. 
+     * @param mentor The mentor for this employee.
+     */
+    public void setMentor(IEmployee mentor) {
+        this.mentor = (FCEmployee)mentor;
+    }
+
+    /**
+     * Get the mentor for this employee.
+     * @return The mentor.
+     */
+    public IEmployee getMentor() {
+        return mentor;
+    }
+
+    /**
+     * Set the protege for this employee.
+     * @param protege The protege for this employee.
+     */
+    public void setProtege(IEmployee protege) {
+        this.protege = (FCEmployee)protege;
+    }
+
+    /**
+     * Get the protege of this employee.
+     * @return The protege of this employee.
+     */
+    public IEmployee getProtege() {
+        return protege;
+    }
+
+    /**
+     * Set the HR advisor for this employee.
+     * @param hradvisor The hradvisor for this employee.
+     */
+    public void setHradvisor(IEmployee hradvisor) {
+        this.hradvisor = (FCEmployee)hradvisor;
+    }
+
+    /**
+     * Get the HR advisor for the employee.
+     * @return The HR advisor.
+     */
+    public IEmployee getHradvisor() {
+        return hradvisor;
+    }
+
+    /**
+     * Get the HR advisees of this HR advisor.
+     * @return An unmodifiable <code>Set</code> containing the
+     * <code>FCEmployee</code>s that are HR advisees of this employee.
+     */
+    public Set getHradvisees() {
+        return Collections.unmodifiableSet(hradvisees);
+    }
+
+    /**
+     * Add an <code>FCEmployee</code> as an advisee of this HR advisor. 
+     * This method also sets the <code>emp</code> hradvisor to reference
+     * this object. In other words, both sides of the relationship are
+     * set. 
+     * @param emp The employee to add as an advisee.
+     */
+    public void addAdvisee(FCEmployee emp) {
+        hradvisees.add(emp);
+        emp.hradvisor = this;
+    }
+
+    /**
+     * Remove an <code>FCEmployee</code> as an advisee of this HR advisor.
+     * This method also sets the <code>emp</code> hradvisor to null.
+     * In other words, both sides of the relationship are set.
+     * @param emp The employee to add as an HR advisee.
+     */
+    public void removeAdvisee(FCEmployee emp) {
+        hradvisees.remove(emp);
+        emp.hradvisor = null;
+    }
+
+    /**
+     * Set the HR advisees of this HR advisor.
+     * @param hradvisees The <code>FCEmployee</code>s that are HR advisees of
+     * this employee. 
+     */
+    public void setHradvisees(Set hradvisees) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null;
+    }
+
+    /** Serialization support: initialize transient fields. */
+    private void readObject(ObjectInputStream in)
+        throws IOException, ClassNotFoundException {
+        in.defaultReadObject();
+        reviewedProjects = new HashSet();
+        projects = new HashSet();
+        team = new HashSet();
+        hradvisees = new HashSet();
+    }
+
+    /**
+     * Return a String representation of a <code>FCEmployee</code> object.
+     * @return a String representation of a <code>FCEmployee</code> object.
+     */
+    public String toString() {
+        return "FCEmployee(" + getFieldRepr() + ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    protected String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(super.getFieldRepr());
+        rc.append(", hired ").append(formatter.format(hiredate));
+        rc.append(", weeklyhours ").append(weeklyhours);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the corresponding fields of the specified FCEmployee.
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IEmployee otherEmp = (IEmployee)other;
+        String where = "Employee<" + getPersonid() + ">";
+        return super.deepCompareFields(otherEmp, helper) &
+            helper.equals(hiredate, otherEmp.getHiredate(),  where + ".hiredate") &
+            helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") &
+            helper.deepEquals(dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") &
+            helper.deepEquals(medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") &
+            helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") &
+            helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") &
+            helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") &
+            helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") &
+            helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") &
+            helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") &
+            helper.deepEquals(reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") &
+            helper.deepEquals(projects, otherEmp.getProjects(), where + ".projects") &
+            helper.deepEquals(team, otherEmp.getTeam(), where + ".team") &
+            helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees");
+    }
+
+}
+

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.util.Date;
+
+import org.apache.jdo.tck.pc.company.IAddress;
+import org.apache.jdo.tck.pc.company.IEmployee;
+import org.apache.jdo.tck.pc.company.IFullTimeEmployee;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a full-time employee.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IFullTimeEmployee")
+@Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE)
+public class FCFullTimeEmployee extends FCEmployee implements IFullTimeEmployee {
+
+    @Column(name="SALARY")
+    private double salary;
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public FCFullTimeEmployee() {}
+
+    /**
+     * Construct a full-time employee.
+     * @param personid The person identifier.
+     * @param first The person's first name.
+     * @param last The person's last name.
+     * @param middle The person's middle name.
+     * @param born The person's birthdate.
+     * @param hired The date that the person was hired.
+     * @param sal The salary of the full-time employee.
+     */
+    public FCFullTimeEmployee(long personid, String first, String last,
+                            String middle, Date born,
+                            Date hired, double sal) {
+        super(personid, first, last, middle, born, hired);
+        salary = sal;
+    }
+
+    /**
+     * Construct a full-time employee.
+     * @param personid The person identifier.
+     * @param first The person's first name.
+     * @param last The person's last name.
+     * @param middle The person's middle name.
+     * @param born The person's birthdate.
+     * @param addr The person's address.
+     * @param hired The date that the person was hired.
+     * @param sal The salary of the full-time employee.
+     */
+    public FCFullTimeEmployee(long personid, String first, String last,
+                            String middle, Date born, IAddress addr, 
+                            Date hired, double sal) {
+        super(personid, first, last, middle, born, addr, hired);
+        salary = sal;
+    }
+
+    /**
+     * Get the salary of the full time employee.
+     * @return The salary of the full time employee.
+     */
+    public double getSalary() {
+        return salary;
+    }
+    
+    /**
+     * Set the salary for the full-time employee.
+     * @param salary The salary to set for the full-time employee.
+     */
+    public void setSalary(double salary) {
+        this.salary = salary;
+    }
+    
+    /**
+     * Return a String representation of a <code>FCFullTimeEmployee</code> object.
+     * @return a String representation of a <code>FCFullTimeEmployee</code> object.
+     */
+    public String toString() {
+        return "FCFullTimeEmployee(" + getFieldRepr() + ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    public String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(super.getFieldRepr());
+        rc.append(", $").append(salary);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the specified
+     * FCFullTimeEmployee. 
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IFullTimeEmployee otherEmp = (IFullTimeEmployee)other;
+        String where = "FCFullTimeEmployee<" + getPersonid() + ">";
+        return super.deepCompareFields(otherEmp, helper) &
+            helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary");
+    }
+    
+}

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,299 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.io.Serializable;
+
+import java.util.Comparator;
+
+import org.apache.jdo.tck.pc.company.IEmployee;
+import org.apache.jdo.tck.pc.company.IInsurance;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents an insurance carrier selection for a particular
+ * <code>FCEmployee</code>.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IInsurance")
+@Table(table="insuranceplans")
+@Inheritance(strategy=InheritanceStrategy.NEW_TABLE)
+@Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME,
+        column="DISCRIMINATOR", indexed="true")
+@Index(name="INS_DISCRIMINATOR_INDEX", unique="false",
+        columns=@Column(name="DISCRIMINATOR"))
+public class FCInsurance 
+    implements IInsurance, Serializable, Comparable, Comparator, DeepEquality  {
+
+    @Field(primaryKey="true")
+    @Column(name="INSID")
+    private long     insid;
+    @Column(name="CARRIER")
+    private String   carrier;
+    @Column(name="EMPLOYEE")
+    private FCEmployee employee;
+
+    /** This is the JDO-required no-args constructor. */
+    protected FCInsurance() {}
+
+    /**
+     * Construct an <code>FCInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     */
+    protected FCInsurance(long insid, String carrier) {
+        this.insid = insid;
+        this.carrier = carrier;
+    }
+
+    /**
+     * Construct an <code>FCInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     * @param employee The employee associated with this insurance. 
+     */
+    protected FCInsurance(long insid, String carrier, IEmployee employee) {
+        this.insid = insid;
+        this.carrier = carrier;
+        this.employee = (FCEmployee)employee;
+    }
+
+    /**
+     * Get the insurance ID.
+     * @return the insurance ID.
+     */
+    public long getInsid() {
+        return insid;
+    }
+
+    /**
+     * Set the insurance ID.
+     * @param id The insurance ID value.
+     */
+    public void setInsid(long id) {
+        if (this.insid != 0) 
+            throw new IllegalStateException("Id is already set.");
+        this.insid = id;
+    }
+
+    /**
+     * Get the insurance carrier.
+     * @return The insurance carrier.
+     */
+    public String getCarrier() {
+        return carrier;
+    }
+
+    /**
+     * Set the insurance carrier.
+     * @param carrier The insurance carrier.
+     */
+    public void setCarrier(String carrier) {
+        this.carrier = carrier;
+    }
+    
+    /**
+     * Get the associated employee.
+     * @return The employee for this insurance.
+     */
+    public IEmployee getEmployee() {
+        return (IEmployee)employee;
+    }
+
+    /**
+     * Set the associated employee.
+     * @param employee The associated employee.
+     */
+    public void setEmployee(IEmployee employee) {
+        this.employee = (FCEmployee)employee;
+    }
+
+    /**
+     * Returns a String representation of a <code>FCInsurance</code> object.
+     * @return a String representation of a <code>FCInsurance</code> object.
+     */
+    public String toString() {
+        return "FCInsurance(" + getFieldRepr() + ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    protected String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(insid);
+        rc.append(", carrier ").append(carrier);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the other Object.
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IInsurance otherIns = (IInsurance)other;
+        String where = "FCInsurance<" + insid + ">";
+        return
+            helper.equals(insid, otherIns.getInsid(), where + ".insid") &
+            helper.equals(carrier, otherIns.getCarrier(), where + ".carrier") &
+            helper.deepEquals(employee, otherIns.getEmployee(), where + ".employee");
+    }
+    
+    /** 
+     * 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((IInsurance)o);
+    }
+
+    /** 
+     * Compare two instances. This is a method in Comparator.
+     */
+    public int compare(Object o1, Object o2) {
+        return compare((IInsurance)o1, (IInsurance)o2);
+    }
+
+    /** 
+     * Compares this object with the specified Insurance 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 Insurance 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
+     * Insurance object. 
+     */
+    public int compareTo(IInsurance other) {
+        return compare(this, other);
+    }
+
+    /**
+     * Compares its two IInsurance arguments for order. Returns a negative
+     * integer, zero, or a positive integer as the first argument is less
+     * than, equal to, or greater than the second. 
+     * @param o1 the first IInsurance object to be compared. 
+     * @param o2 the second IInsurance object to be compared. 
+     * @return a negative integer, zero, or a positive integer as the first
+     * object is less than, equal to, or greater than the second object. 
+     */
+    public static int compare(IInsurance o1, IInsurance o2) {
+        return EqualityHelper.compare(o1.getInsid(), o2.getInsid());
+    }
+    
+    /** 
+     * Indicates whether some other object is "equal to" this one.
+     * @param obj the object with which to compare.
+     * @return <code>true</code> if this object is the same as the obj
+     * argument; <code>false</code> otherwise. 
+     */
+    public boolean equals(Object obj) {
+        if (obj instanceof IInsurance) {
+            return compareTo((IInsurance)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)insid;
+    }
+
+    /**
+     * This class is used to represent the application
+     * identifier for the <code>Insurance</code> class.
+     */
+    public static class Oid implements Serializable, Comparable 
+    {
+        /**
+         * This field represents the application identifier for the
+         * <code>Insurance</code> class. It must match the field in the
+         * <code>Insurance</code> class in both name and type. 
+         */
+        public long insid;
+        
+        /**
+         * The required public no-args constructor.
+         */
+        public Oid() { }
+
+        /**
+         * Initialize with an insurance identifier.
+         * @param insid the insurance ID.
+         */
+        public Oid(long insid) {
+            this.insid = insid;
+        }
+        
+        public Oid(String s) { insid = Long.parseLong(justTheId(s)); }
+
+        public String toString() { return this.getClass().getName() + ": "  + insid;}
+
+
+        /** */
+        public boolean equals(java.lang.Object obj) {
+            if( obj==null || !this.getClass().equals(obj.getClass()) )
+                return( false );
+            Oid o=(Oid) obj;
+            if( this.insid!=o.insid ) return( false );
+            return( true );
+        }
+
+        /** */
+        public int hashCode() {
+            return( (int) insid );
+        }
+        
+        protected static String justTheId(String str) {
+            return str.substring(str.indexOf(':') + 1);
+        }
+
+        /** */
+        public int compareTo(Object obj) {
+            // may throw ClassCastException which the user must handle
+            Oid other = (Oid) obj;
+            if( insid < other.insid ) return -1;
+            if( insid > other.insid ) return 1;
+            return 0;
+        }
+
+    }
+
+}
+

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.io.Serializable;
+
+import org.apache.jdo.tck.pc.company.IEmployee;
+import org.apache.jdo.tck.pc.company.IMedicalInsurance;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a dental insurance carrier selection for a
+ * particular <code>Employee</code>.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IInsurance")
+public class FCMedicalInsurance extends FCInsurance implements IMedicalInsurance {
+
+    @Column(name="PLANTYPE")
+    private String planType; // possible values: "PPO", "EPO", "NPO" 
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public FCMedicalInsurance() {}
+
+    /**
+     * Construct a <code>FCMedicalInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     * @param planType The planType.
+     */
+    public FCMedicalInsurance(long insid, String carrier, 
+                            String planType)
+    {
+        super(insid, carrier);
+        this.planType = planType;
+    }
+
+    /**
+     * Construct a <code>FCMedicalInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     * @param employee The employee associated with this insurance.
+     * @param planType The planType.
+     */
+    public FCMedicalInsurance(long insid, String carrier, 
+                            IEmployee employee, String planType)
+    {
+        super(insid, carrier, employee);
+        this.planType = planType;
+    }
+
+    /**
+     * Get the insurance planType.
+     * @return The insurance planType.
+     */
+    public String getPlanType() {
+        return planType;
+    }
+
+    /**
+     * Set the insurance planType.
+     * @param planType The insurance planType.
+     */
+    public void setPlanType(String planType) {
+        this.planType = planType;
+    }
+
+    /**
+     * Returns a String representation of a <code>FCMedicalInsurance</code>
+     * object.
+     * @return a String representation of a <code>FCMedicalInsurance</code>
+     * object.
+     */
+    public String toString() {
+        return "FCMedicalInsurance(" + getFieldRepr() + ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    protected String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(super.getFieldRepr());
+        rc.append(", planType ").append(planType);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the other Object.
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IMedicalInsurance otherIns = (IMedicalInsurance)other;
+        String where = "FCMedicalInsurance<" + getInsid() + ">";
+        return super.deepCompareFields(otherIns, helper) &
+            helper.equals(planType, otherIns.getPlanType(), where + ".planType");
+    }
+}
+

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.util.Date;
+
+import org.apache.jdo.tck.pc.company.IAddress;
+import org.apache.jdo.tck.pc.company.IPartTimeEmployee;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a part-time employee.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IPartTimeEmployee")
+@Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE)
+public class FCPartTimeEmployee extends FCEmployee implements IPartTimeEmployee {
+
+    @Column(name="WAGE")
+    private double wage;
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public FCPartTimeEmployee() {}
+
+    /**
+     * Construct a part-time employee.
+     * @param personid The identifier for the person.
+     * @param first The person's first name.
+     * @param last The person's last name.
+     * @param middle The person's middle name.
+     * @param born The person's birthdate.
+     * @param hired The date the person was hired.
+     * @param wage The person's wage.
+     */
+    public FCPartTimeEmployee(long personid, String first, String last,
+                            String middle, Date born,
+                            Date hired, double wage ) {
+        super(personid, first, last, middle, born, hired);
+        this.wage = wage;
+    }
+
+    /**
+     * Construct a part-time employee.
+     * @param personid The identifier for the person.
+     * @param first The person's first name.
+     * @param last The person's last name.
+     * @param middle The person's middle name.
+     * @param born The person's birthdate.
+     * @param addr The person's address.
+     * @param hired The date the person was hired.
+     * @param wage The person's wage.
+     */
+    public FCPartTimeEmployee(long personid, String first, String last,
+                            String middle, Date born, IAddress addr, 
+                            Date hired, double wage ) {
+        super(personid, first, last, middle, born, addr, hired);
+        this.wage = wage;
+    }
+
+    /**
+     * Get the wage of the part-time employee.
+     * @return The wage of the part-time employee.
+     */
+    public double getWage() {
+        return wage;
+    }
+
+    /**
+     * Set the wage of the part-time employee.
+     * @param wage The wage of the part-time employee.
+     */
+    public void setWage(double wage) {
+        this.wage = wage;
+    }
+
+    /**
+     * Returns a String representation of a <code>FCPartTimeEmployee</code> object.
+     * @return a String representation of a <code>FCPartTimeEmployee</code> object.
+     */
+    public String toString() {
+        return "FCPartTimeEmployee(" + getFieldRepr() + ")";
+    }
+
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    public String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(super.getFieldRepr());
+        rc.append(", $" + wage);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the specified
+     * FCPartTimeEmployee. 
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                        EqualityHelper helper) {
+        IPartTimeEmployee otherEmp = (IPartTimeEmployee)other;
+        String where = "FCPartTimeEmployee<" + getPersonid() + ">";
+        return super.deepCompareFields(otherEmp, helper) &
+            helper.closeEnough(wage, otherEmp.getWage(), where + ".wage");
+    }
+}

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java?view=auto&rev=552622
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java Mon Jul  2 16:09:43 2007
@@ -0,0 +1,451 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+
+package org.apache.jdo.tck.pc.companyAnnotatedApp;
+
+import javax.jdo.annotations.*;
+
+import java.io.Serializable;
+
+import java.text.SimpleDateFormat;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jdo.tck.pc.company.IAddress;
+import org.apache.jdo.tck.pc.company.IPerson;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a person.
+ */
+@PersistenceCapable(identityType=IdentityType.APPLICATION)
+@Implements ("org.apache.jdo.tck.pc.company.IPerson")
+@Table(table="persons")
+@Inheritance(strategy=InheritanceStrategy.NEW_TABLE)
+@Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME,
+        column="DISCRIMINATOR", indexed="true")
+public class FCPerson 
+    implements IPerson, Serializable, Comparable, Comparator, DeepEquality  {
+
+    @Field(primaryKey="true")
+    @Column(name="PERSONID")
+    private long    personid;
+    @Column(name="FIRSTNAME")
+    private String  firstname;
+    @Column(name="LASTNAME")
+    private String  lastname;
+    @Field(defaultFetchGroup="false")
+    @Column(name="MIDDLENAME", allowsNull="true")
+    private String  middlename;
+    private Date    birthdate;
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
+    @Embedded(nullIndicatorColumn="COUNTRY",
+        fields={
+            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
+            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
+            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
+            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
+            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+    })
+    private FCAddress address;
+
+    // maps phone number types ("home", "work", "mobile", etc.) 
+    // to phone numbers specified as String
+    @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
+    @Join(column="EMPID")
+    @JoinTable(table="employee_phoneno_type")
+    @Key(types=java.lang.String.class, column="TYPE")
+    @Value(types=java.lang.String.class, column="PHONENO")
+    private Map phoneNumbers = new HashMap();
+    
+    protected static SimpleDateFormat formatter =
+        new SimpleDateFormat("d/MMM/yyyy");
+
+    /** This is the JDO-required no-args constructor. */
+    protected FCPerson() {}
+
+    /**
+     * Construct a <code>FCPerson</code> instance.
+     * @param personid The person identifier.
+     * @param firstname The person's first name.
+     * @param lastname The person's last name.
+     * @param middlename The person's middle name.
+     * @param birthdate The person's birthdate.
+     */
+    public FCPerson(long personid, String firstname, String lastname, 
+                  String middlename, Date birthdate) {
+        this.personid = personid;
+        this.firstname = firstname;
+        this.lastname = lastname;
+        this.middlename = middlename;
+        this.birthdate = birthdate;
+    }
+
+    /**
+     * Construct a <code>FCPerson</code> instance.
+     * @param personid The person identifier.
+     * @param firstname The person's first name.
+     * @param lastname The person's last name.
+     * @param middlename The person's middle name.
+     * @param birthdate The person's birthdate.
+     * @param address The person's address.
+     */
+    public FCPerson(long personid, String firstname, String lastname, 
+                  String middlename, Date birthdate, IAddress address) {
+        this(personid, firstname, lastname, middlename, birthdate);
+        this.address = (FCAddress)address;
+    }
+
+    /**
+     * Set the id associated with this object.
+     * @param id the id.
+     */
+    public void setPersonid(long id) {
+        if (this.personid != 0)
+            throw new IllegalStateException("Id is already set.");
+        this.personid = id;
+    }
+
+    /**
+     * Get the person's id.
+     * @return The personid.
+     */
+    public long getPersonid() {
+        return personid;
+    }
+
+    /**
+     * Set the person's id.
+     * @param personid The personid.
+     */
+    public void setLastname(long personid) {
+        this.personid = personid;
+    }
+
+    /**
+     * Get the person's last name.
+     * @return The last name.
+     */
+    public String getLastname() {
+        return lastname;
+    }
+
+    /**
+     * Set the person's last name.
+     * @param lastname The last name.
+     */
+    public void setLastname(String lastname) {
+        this.lastname = lastname;
+    }
+
+    /**
+     * Get the person's first name.
+     * @return The first name.
+     */
+    public String getFirstname() {
+        return firstname;
+    }
+
+    /**
+     * Set the person's first name.
+     * @param firstname The first name.
+     */
+    public void setFirstname(String firstname) {
+        this.firstname = firstname;
+    }
+
+    /**
+     * Get the person's middle name.
+     * @return The middle name.
+     */
+    public String getMiddlename() {
+        return middlename;
+    }
+
+    /**
+     * Set the person's middle name.
+     * @param middlename The middle name.
+     */
+    public void setMiddlename(String middlename) {
+        this.middlename = middlename;
+    }
+
+    /**
+     * Get the address.
+     * @return The address.
+     */
+    public IAddress getAddress() {
+        return address;
+    }
+
+    /**
+     * Set the address.
+     * @param address The address.
+     */
+    public void setAddress(IAddress address) {
+        this.address = (FCAddress)address;
+    }
+
+    /**
+     * Get the person's birthdate.
+     * @return The person's birthdate.
+     */
+    public Date getBirthdate() {
+        return birthdate;
+    }
+
+    /**
+     * Set the person's birthdate.
+     * @param birthdate The person's birthdate.
+     */
+    public void setBirthdate(Date birthdate) {
+        this. birthdate = birthdate;
+    }
+
+    /**
+     * Get the map of phone numbers as an unmodifiable map.
+     * @return The map of phone numbers, as an unmodifiable map.
+     */
+    public Map getPhoneNumbers() {
+        return Collections.unmodifiableMap(phoneNumbers);
+    }
+
+    /**
+     * Get the phone number for the specified phone number type. 
+     * @param type The phone number type ("home", "work", "mobile", etc.).
+     * @return The phone number associated with specified type, or
+     * <code>null</code> if there was no phone number for the type. 
+     */
+    public String getPhoneNumber(String type) {
+        return (String)phoneNumbers.get(type);
+    }
+    
+    /**
+     * Associates the specified phone number with the specified type in the
+     * map of phone numbers of this person. 
+     * @param type The phone number type ("home", "work", "mobile", etc.).
+     * @param phoneNumber The phone number 
+     * @return The previous phone number associated with specified type, or
+     * <code>null</code> if there was no phone number for the type. 
+     */
+    public String putPhoneNumber(String type, String phoneNumber) {
+        return (String)phoneNumbers.put(type, phoneNumber);
+    }
+
+    /**
+     * Remove a phoneNumber from the map of phone numbers.
+     * @param type The phone number type ("home", "work", "mobile", etc.).
+     * @return The previous phone number associated with specified type, or
+     * <code>null</code> if there was no phone number for the type. 
+     */
+    public String removePhoneNumber(String type) {
+        return (String)phoneNumbers.remove(type);
+    }
+
+    /**
+     * Set the phoneNumber map to be in this person.
+     * @param phoneNumbers The map of phoneNumbers for this person.
+     */
+    public void setPhoneNumbers(Map phoneNumbers) {
+        // workaround: create a new HashMap, because fostore does not
+        // support LinkedHashMap
+        this.phoneNumbers = 
+            (phoneNumbers != null) ? new HashMap(phoneNumbers) : null;
+    }
+
+    /**
+     * Returns a String representation of a <code>FCPerson</code> object.
+     * @return a string representation of a <code>FCPerson</code> object.
+     */
+    public String toString() {
+        return "FCPerson(" + getFieldRepr() + ")";
+    }
+    
+    /**
+     * Returns a String representation of the non-relationship fields.
+     * @return a String representation of the non-relationship fields.
+     */
+    protected String getFieldRepr() {
+        StringBuffer rc = new StringBuffer();
+        rc.append(personid);
+        rc.append(", ").append(lastname);
+        rc.append(", ").append(firstname);
+        rc.append(", born ").append(formatter.format(birthdate));
+        rc.append(", phone ").append(phoneNumbers);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> if all the fields of this instance are
+     * deep equal to the coresponding fields of the specified FCPerson.
+     * @param other the object with which to compare.
+     * @param helper EqualityHelper to keep track of instances that have
+     * already been processed. 
+     * @return <code>true</code> if all the fields are deep equal;
+     * <code>false</code> otherwise.  
+     * @throws ClassCastException if the specified instances' type prevents
+     * it from being compared to this instance. 
+     */
+    public boolean deepCompareFields(Object other, 
+                                     EqualityHelper helper) {
+        IPerson otherPerson = (IPerson)other;
+        String where = "FCPerson<" + personid + ">";
+        return 
+            helper.equals(personid, otherPerson.getPersonid(), where + ".personid") &
+            helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") &
+            helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") &
+            helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename") &
+            helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate") &
+            helper.deepEquals(address, otherPerson.getAddress(), where + ".address") &
+            helper.deepEquals(phoneNumbers, otherPerson.getPhoneNumbers(), where + ".phoneNumbers");
+    }
+
+    /** 
+     * 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((IPerson)o);
+    }
+
+    /** 
+     * Compare two instances. This is a method in Comparator.
+     */
+    public int compare(Object o1, Object o2) {
+        return compare((IPerson)o1, (IPerson)o2);
+    }
+
+    /** 
+     * Compares this object with the specified FCPerson 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 FCPerson 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 FCPerson 
+     * object. 
+     */
+    public int compareTo(IPerson other) {
+        return compare(this, other);
+    }
+
+    /**
+     * Compares its two IPerson arguments for order. Returns a negative
+     * integer, zero, or a positive integer as the first argument is less
+     * than, equal to, or greater than the second. 
+     * @param o1 the first IPerson object to be compared. 
+     * @param o2 the second IPerson object to be compared. 
+     * @return a negative integer, zero, or a positive integer as the first
+     * object is less than, equal to, or greater than the second object. 
+     */
+    public static int compare(IPerson o1, IPerson o2) {
+        return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid());
+    }
+    
+    /** 
+     * Indicates whether some other object is "equal to" this one.
+     * @param obj the object with which to compare.
+     * @return <code>true</code> if this object is the same as the obj
+     * argument; <code>false</code> otherwise. 
+     */
+    public boolean equals(Object obj) {
+        if (obj instanceof IPerson) {
+            return compareTo((IPerson)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)personid;
+    }
+    /**
+     * This class is used to represent the application identifier
+     * for the <code>Person</code> class.
+     */
+    public static class Oid implements Serializable, Comparable {
+
+        /**
+         * This field represents the identifier for the <code>Person</code>
+         * class. It must match a field in the <code>Person</code> class in
+         * both name and type. 
+         */
+        public long personid;
+
+        /**
+         * The required public no-arg constructor.
+         */
+        public Oid() { }
+
+        /**
+         * Initialize the identifier.
+         * @param personid The person identifier.
+         */
+        public Oid(long personid) {
+            this.personid = personid;
+        }
+        
+        public Oid(String s) { personid = Long.parseLong(justTheId(s)); }
+
+        public String toString() { return this.getClass().getName() + ": "  + personid;}
+
+        /** */
+        public boolean equals(java.lang.Object obj) {
+            if( obj==null ||
+                !this.getClass().equals(obj.getClass()) ) return( false );
+            Oid o = (Oid) obj;
+            if( this.personid != o.personid ) return( false );
+            return( true );
+        }
+
+        /** */
+        public int hashCode() {
+            return( (int) personid );
+        }
+        
+        protected static String justTheId(String str) {
+            return str.substring(str.indexOf(':') + 1);
+        }
+
+        /** */
+        public int compareTo(Object obj) {
+            // may throw ClassCastException which the user must handle
+            Oid other = (Oid) obj;
+            if( personid < other.personid ) return -1;
+            if( personid > other.personid ) return 1;
+            return 0;
+        }
+
+    }
+
+}

Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java
------------------------------------------------------------------------------
    svn:eol-style = LF



Mime
View raw message