db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r582405 [1/2] - /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/
Date Fri, 05 Oct 2007 21:38:27 GMT
Author: mcaisse
Date: Fri Oct  5 14:38:26 2007
New Revision: 582405

URL: http://svn.apache.org/viewvc?rev=582405&view=rev
Log: (empty)

Added:
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppConcrete.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppPM.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedPMFieldClassJPA.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppAddress.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppCompany.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDepartment.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppEmployee.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppInsurance.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppMedicalInsurance.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPartTimeEmployee.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java   (with props)
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppProject.java   (with props)

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppConcrete.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppConcrete.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppConcrete.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppConcrete.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,86 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.jdo.PersistenceManager;
+import org.apache.jdo.tck.pc.company.*;
+
+/*
+ * CompanyFactoryAnnotatedPMFieldClass.java
+ *
+ * This class uses the PersistenceManager.newInstance method with the concrete
+ * class as a parameter.
+ */
+public class CompanyFactoryAnnotatedJPAAppConcrete
+        extends CompanyFactoryAbstractImpl {
+    
+    PersistenceManager pm = null;
+    
+    /**
+     * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass
+     */
+    public CompanyFactoryAnnotatedJPAAppConcrete(PersistenceManager pm) {
+        super(pm);
+        this.pm = pm;        
+    }
+    
+    public Class[] getTearDownClasses() {
+        return new Class[] {
+            JPAAppDentalInsurance.class,
+            JPAAppMedicalInsurance.class,
+            JPAAppPartTimeEmployee.class,
+            JPAAppFullTimeEmployee.class,
+            JPAAppProject.class,
+            JPAAppDepartment.class,
+            JPAAppCompany.class,
+            JPAAppAddress.class
+        };
+    }
+    
+    public IAddress newAddress() {
+        return (IAddress) new JPAAppAddress();
+    }
+    
+    public ICompany newCompany() {
+        return (ICompany) new JPAAppCompany();
+    }
+    
+    public IDentalInsurance newDentalInsurance() {
+        return (IDentalInsurance) new JPAAppDentalInsurance();
+    }
+    
+    public IDepartment newDepartment() {
+        return (IDepartment) new JPAAppDepartment();
+    }
+    
+    public IFullTimeEmployee newFullTimeEmployee() {
+        return (IFullTimeEmployee) new JPAAppFullTimeEmployee();
+    }
+    
+    public IMedicalInsurance newMedicalInsurance() {
+        return (IMedicalInsurance) new JPAAppMedicalInsurance();
+    }
+    
+    public IPartTimeEmployee newPartTimeEmployee() {
+        return (IPartTimeEmployee) new JPAAppPartTimeEmployee();
+    }
+    
+    public IProject newProject() {
+        return (IProject) new JPAAppProject();
+    }
+}

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

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppPM.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppPM.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppPM.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppPM.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,85 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.jdo.PersistenceManager;
+import org.apache.jdo.tck.pc.company.*;
+
+/*
+ * CompanyFactoryAnnotatedPMFieldClass.java
+ *
+ * This class uses the PersistenceManager.newInstance method with the concrete
+ * class as a parameter.
+ */
+public class CompanyFactoryAnnotatedJPAAppPM
+        implements CompanyFactoryNewInstance {
+    
+    PersistenceManager pm = null;
+    
+    /**
+     * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass
+     */
+    public CompanyFactoryAnnotatedJPAAppPM(PersistenceManager pm) {
+        this.pm = pm;        
+    }
+    
+    public Class[] getTearDownClasses() {
+        return new Class[] {
+            JPAAppDentalInsurance.class,
+            JPAAppMedicalInsurance.class,
+            JPAAppPartTimeEmployee.class,
+            JPAAppFullTimeEmployee.class,
+            JPAAppProject.class,
+            JPAAppDepartment.class,
+            JPAAppCompany.class,
+            JPAAppAddress.class
+        };
+    }
+    
+    public IAddress newAddress() {
+        return (IAddress)pm.newInstance(JPAAppAddress.class);
+    }
+    
+    public ICompany newCompany() {
+        return (ICompany)pm.newInstance(JPAAppCompany.class);
+    }
+    
+    public IDentalInsurance newDentalInsurance() {
+        return (IDentalInsurance)pm.newInstance(JPAAppDentalInsurance.class);
+    }
+    
+    public IDepartment newDepartment() {
+        return (IDepartment)pm.newInstance(JPAAppDepartment.class);
+    }
+    
+    public IFullTimeEmployee newFullTimeEmployee() {
+        return (IFullTimeEmployee)pm.newInstance(JPAAppFullTimeEmployee.class);
+    }
+    
+    public IMedicalInsurance newMedicalInsurance() {
+        return (IMedicalInsurance)pm.newInstance(JPAAppMedicalInsurance.class);
+    }
+    
+    public IPartTimeEmployee newPartTimeEmployee() {
+        return (IPartTimeEmployee)pm.newInstance(JPAAppPartTimeEmployee.class);
+    }
+    
+    public IProject newProject() {
+        return (IProject)pm.newInstance(JPAAppProject.class);
+    }
+}

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

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedPMFieldClassJPA.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedPMFieldClassJPA.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedPMFieldClassJPA.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedPMFieldClassJPA.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,107 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.jdo.PersistenceManager;
+import org.apache.jdo.tck.pc.company.*;
+
+/*
+ * CompanyFactoryAnnotatedPMFieldClassJPA.java
+ *
+ * This class uses the PersistenceManager.newInstance method with the concrete
+ * class as a parameter.
+ */
+public class CompanyFactoryAnnotatedPMFieldClassJPA
+        extends org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl {
+    
+    Class addressClass = null;
+    Class dentalInsuranceClass = null;
+    Class medicalInsuranceClass = null;
+    Class partTimeEmployeeClass = null;
+    Class fullTimeEmployeeClass = null;
+    Class projectClass = null;
+    Class departmentClass = null;
+    Class companyClass = null;
+    
+    /**
+     * Creates a new instance of CompanyFactoryAnnotatedPMFieldClassJPA
+     */
+    public CompanyFactoryAnnotatedPMFieldClassJPA(PersistenceManager pm) {
+        super(pm);
+            addressClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppAddress.class;
+            dentalInsuranceClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppDentalInsurance.class;
+            medicalInsuranceClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppMedicalInsurance.class;
+            partTimeEmployeeClass  =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppPartTimeEmployee.class;
+            fullTimeEmployeeClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppFullTimeEmployee.class;
+            projectClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class;
+            departmentClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppDepartment.class;
+            companyClass =
+                    org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppCompany.class;
+    }
+    
+    public Class[] getTearDownClasses() {
+        return new Class[] {
+            dentalInsuranceClass,
+            medicalInsuranceClass,
+            partTimeEmployeeClass,
+            fullTimeEmployeeClass,
+            projectClass,
+            departmentClass,
+            companyClass
+        };
+    }
+    
+    public IAddress newAddress() {
+        return (IAddress)pm.newInstance(addressClass);
+    }
+    
+    public ICompany newCompany() {
+        return (ICompany)pm.newInstance(companyClass);
+    }
+    
+    public IDentalInsurance newDentalInsurance() {
+        return (IDentalInsurance)pm.newInstance(dentalInsuranceClass);
+    }
+    
+    public IDepartment newDepartment() {
+        return (IDepartment)pm.newInstance(departmentClass);
+    }
+    
+    public IFullTimeEmployee newFullTimeEmployee() {
+        return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass);
+    }
+    
+    public IMedicalInsurance newMedicalInsurance() {
+        return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass);
+    }
+    
+    public IPartTimeEmployee newPartTimeEmployee() {
+        return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass);
+    }
+    
+    public IProject newProject() {
+        return (IProject)pm.newInstance(projectClass);
+    }
+}

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

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppAddress.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppAddress.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppAddress.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppAddress.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,349 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+import javax.persistence.*;
+
+import org.apache.jdo.tck.pc.company.IAddress;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a postal address.
+ */
+@Embeddable
+public class JPAAppAddress 
+    implements IAddress, Serializable, Comparable, Comparator, DeepEquality {
+
+    private long    addrid;
+    private String  street;
+    private String  city;
+    private String  state;
+    private String  zipcode;
+    private String  country;
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public JPAAppAddress() {}
+
+    /**
+     * This constructor initializes the <code>JPAAppAddress</code> components.
+     * 
+     * 
+     * 
+     * @param addrid The address ID.
+     * @param street The street address.
+     * @param city The city.
+     * @param state The state.
+     * @param zipcode The zip code.
+     * @param country The zip country.
+     */
+    public JPAAppAddress(long addrid, String street, String city, 
+                   String state, String zipcode, String country)
+    {
+        this.addrid = addrid;
+        this.street = street;
+        this.city = city;
+        this.state = state;
+        this.zipcode = zipcode;
+        this.country = country;
+    }
+
+    /**
+     * Get the addrid associated with this object.
+     * @return the addrid.
+     */
+    public long getAddrid() {
+        return addrid;
+    }
+
+    /**
+     * Set the id associated with this object.
+     * @param id the id.
+     */
+    public void setAddrid(long id) {
+        if (this.addrid != 0)
+            throw new IllegalStateException("Id is already set.");
+        this.addrid = id;
+    }
+
+    /** 
+     * Get the street component of the address.
+     * @return The street component of the address.
+     */
+    public String getStreet() {
+        return street;
+    }
+
+    /**
+     * Set the street component of the address.
+     * @param street The street component.
+     */
+    public void setStreet(String street) {
+        this.street = street;
+    }
+
+    /**
+     * Get the city.
+     * @return The city component of the address.
+     */
+    public String getCity() {
+        return city;
+    }
+
+    /**
+     * Set the city component of the address.
+     * @param city The city.
+     */
+    public void setCity(String city) {
+        this.city = city;
+    }
+    
+    /**
+     * Get the state component of the address.
+     * @return The state.
+     */
+    public String getState() {
+        return state;
+    }
+
+    /**
+     * Set the state component of the address.
+     * @param state The state.
+     */
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    /**
+     * Get the zipcode component of the address.
+     * @return The zipcode.
+     */
+    public String getZipcode() {
+        return zipcode;
+    }
+
+    /**
+     * Set the zip code component of the address.
+     * @param zipcode The zipcode.
+     */
+    public void setZipcode(String zipcode) {
+        this.zipcode = zipcode;
+    }
+
+    /**
+     * Get the country component of the address.
+     * @return The country.
+     */
+    public String getCountry() {
+        return country;
+    }
+
+    /**
+     * Set the country component of the address.
+     * @param country The country.
+     */
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    /**
+     * Returns a String representation of a <code>Address</code> object.
+     * @return a String representation of a <code>Address</code> object.
+     */
+    public String toString() {
+        return "Address(" + 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(addrid);
+        rc.append(", street ").append(street);
+        rc.append(", city ").append(city);
+        rc.append(", state ").append(state);
+        rc.append(", zipcode ").append(zipcode);
+        rc.append(", country ").append(country);
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> 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 <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) {
+        JPAAppAddress otherAddress = (JPAAppAddress)other;
+        String where = "Address<" + addrid + ">";
+        return
+            helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") &
+            helper.equals(street, otherAddress.getStreet(), where + ".street") &
+            helper.equals(city, otherAddress.getCity(), where + ".city") &
+            helper.equals(state, otherAddress.getState(), where + ".state") &
+            helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") &
+            helper.equals(country, otherAddress.getCountry(), where + ".country");
+    }
+    
+    /** 
+     * 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((JPAAppAddress)o);
+    }
+
+    /** 
+     * Compare two instances. This is a method in Comparator.
+     */
+    public int compare(Object o1, Object o2) {
+        return compare((JPAAppAddress)o1, (JPAAppAddress)o2);
+    }
+
+    /** 
+     * Compares this object with the specified Address 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 Address 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 Address
+     * object. 
+     */
+    public int compareTo(JPAAppAddress other) {
+        return compare(this, other);
+    }
+    
+    /**
+     * Compares its two JPAAppAddress 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 JPAAppAddresss object to be compared.
+     * @param o2 the second JPAAppAddressobject 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(JPAAppAddress o1, JPAAppAddress o2) {
+        return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid());
+    }
+
+    /** 
+     * 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 JPAAppAddress) {
+            return compareTo((JPAAppAddress)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)addrid;
+    }
+    
+    /**
+     * This class is used to represent the application identifier 
+     * for the <code>Address</code> class.
+     */
+    public static class Oid implements Serializable, Comparable {
+
+        /**
+         * This is the identifier field for <code>Address</code> and must
+         * correspond in type and name to the field in
+         * <code>Address</code>. 
+         */
+        public long addrid;
+        
+        /** The required public, no-arg constructor. */
+        public Oid()
+        {
+            addrid = 0;
+        }
+
+        /**
+         * A constructor to initialize the identifier field.
+         * @param addrid the id of the Address.
+         */
+        public Oid(long addrid) {
+            this.addrid = addrid;
+        }
+        
+        public Oid(String s) { addrid = Long.parseLong(justTheId(s)); }
+
+        public String toString() { return this.getClass().getName() + ": "  + addrid;}
+
+
+        /** */
+        public boolean equals(java.lang.Object obj) {
+            if( obj==null || !this.getClass().equals(obj.getClass()) )
+                return( false );
+            Oid o = (Oid) obj;
+            if( this.addrid != o.addrid ) return( false );
+            return( true );
+        }
+
+        /** */
+        public int hashCode() {
+            return( (int) addrid );
+        }
+        
+        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( addrid < other.addrid ) return -1;
+            if( addrid > other.addrid ) return 1;
+            return 0;
+        }
+
+    }
+
+}

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

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppCompany.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppCompany.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppCompany.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppCompany.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,402 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.persistence.*;
+
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.IOException;
+
+import java.text.SimpleDateFormat;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Date;
+import org.apache.jdo.tck.pc.company.IAddress;
+
+import org.apache.jdo.tck.pc.company.ICompany;
+import org.apache.jdo.tck.util.DeepEquality;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents information about a company.
+ */
+@Entity(name="Company")
+@Table(name="companies")
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING,
+        name="DISCRIMINATOR")
+    public class JPAAppCompany 
+    implements ICompany, Serializable, Comparable, Comparator, DeepEquality {
+
+    @Id
+    @Column(name="ID")
+    private long        companyid;
+    @Column(name="NAME")
+    private String      name;
+    @Column(name="FOUNDEDDATE")
+    @Temporal(TemporalType.DATE)
+    private Date        founded;
+    @Basic
+    @Embedded
+        @AttributeOverrides({
+            @AttributeOverride(name="street",
+                column=@Column(name="STREET")),
+            @AttributeOverride(name="city",
+                column=@Column(name="CITY")),
+            @AttributeOverride(name="state",
+                   column=@Column(name="STATE")),
+            @AttributeOverride(name="zipcode",
+                   column=@Column(name="ZIPCODE")),
+            @AttributeOverride(name="country",
+                   column=@Column(name="COUNTRY"))
+        })
+    private JPAAppAddress     address;
+    @OneToMany(mappedBy="company")
+    private Set<JPAAppDepartment> departments = new HashSet();
+
+    protected static SimpleDateFormat formatter =
+        new SimpleDateFormat("d/MMM/yyyy");
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public JPAAppCompany() {}
+
+    /**
+     * 
+     * Initialize the <code>JPAAppCompany</code> instance.
+     * 
+     * 
+     * @param companyid The company id.
+     * @param name The company name.
+     * @param founded The date the company was founded.
+     */
+    public JPAAppCompany(long companyid, String name, Date founded) {
+        this.companyid = companyid;
+        this.name = name;
+        this.founded = founded;
+    }
+
+    /** 
+     * Initialize the <code>Company</code> instance.
+     * @param companyid The company id.
+     * @param name The company name.
+     * @param founded The date the company was founded.
+     * @param addr The company's address.
+     */
+    public JPAAppCompany(long companyid, String name, Date founded, IAddress addr) {
+        this(companyid, name, founded);
+        this.address = (JPAAppAddress)addr;
+    }
+
+    /**
+     * Get the company id.
+     * @return The company id.
+     */
+    public long getCompanyid() {
+        return companyid;
+    }
+    
+    /** 
+     * Set the id associated with this object.
+     * @param id the id.
+     */
+    public void setCompanyid(long id) {
+        if (this.companyid != 0)
+            throw new IllegalStateException("Id is already set.");
+        this.companyid = id;
+    }
+
+    /**
+     * Get the name of the company.
+     * @return The name of the company.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Set the  name of the company.
+     * @param name The value to use for the name of the company.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Get the date that the company was founded.
+     * @return The date the company was founded.
+     */
+    public Date getFounded() {
+        return founded;
+    }
+
+    /**
+     * Set the date that the company was founded.
+     * @param founded The date to set that the company was founded.
+     */
+    public void setFounded(Date founded) {
+        this.founded = founded;
+    }
+
+    /**
+     * Get the address of the company.
+     * @return The primary address of the company.
+     */
+    public IAddress getAddress() {
+        return address;
+    }
+    
+    /**
+     * Set the primary address for the company.
+     * @param address The address to set for the company.
+     */
+    public void setAddress(IAddress address) {
+        this.address = (JPAAppAddress)address;
+    }
+
+    /**
+     * Get the departments contained in the company.
+     * 
+     * 
+     * @return An unmodifiable <code>Set</code> that contains all the
+     * <code>JPAAppDepartment</code>s of the company.
+     */
+    public Set getDepartments() {
+        return Collections.unmodifiableSet(departments);
+    }
+
+    /**
+     * Add a <code>JPAAppDepartment</code> instance to the company.
+     * 
+     * 
+     * @param dept The <code>JPAAppDepartment</code> instance to add.
+     */
+    public void addDepartment(JPAAppDepartment dept) {
+        departments.add(dept);
+    }
+
+    /**
+     * Remove a <code>JPAAppDepartment</code> instance from the company.
+     * 
+     * 
+     * @param dept The <code>JPAAppDepartment</code> instance to remove.
+     */
+    public void removeDepartment(JPAAppDepartment dept) {
+        departments.remove(dept);
+    }
+
+    /**
+     * Initialize the set of <code>JPAAppDepartment</code>s in the company to the 
+     * parameter. 
+     * 
+     * 
+     * @param departments The set of <code>JPAAppDepartment</code>s for the
+     * company.
+     */
+    public void setDepartments(Set departments) {
+        // workaround: create a new HashSet, because fostore does not
+        // support LinkedHashSet
+        this.departments = 
+            (departments != null) ? new HashSet(departments) : null;
+    }
+    
+    /** Serialization support: initialize transient fields. */
+    private void readObject(ObjectInputStream in)
+        throws IOException, ClassNotFoundException {
+        in.defaultReadObject();
+        departments = new HashSet();
+    }
+
+    /**
+     * Returns a String representation of a <code>Company</code> object.
+     * @return a String representation of a <code>Company</code> object.
+     */
+    public String toString() {
+        return "Company(" + 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(companyid);
+        rc.append(", name ").append(name);
+        rc.append(", founded ").append(formatter.format(founded));
+        return rc.toString();
+    }
+
+    /** 
+     * Returns <code>true</code> 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 <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) {
+        JPAAppCompany otherCompany = (JPAAppCompany)other;
+        String where = "Company<" + companyid + ">";
+        return 
+            helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") &
+            helper.equals(name, otherCompany.getName(), where + ".name") &
+            helper.equals(founded, otherCompany.getFounded(), where + ".founded") &
+            helper.deepEquals(address, otherCompany.getAddress(), where + ".address") &
+            helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments");
+    }
+    
+    /** 
+     * 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((JPAAppCompany)o);
+    }
+
+    /** 
+     * Compare two instances. This is a method in Comparator.
+     */
+    public int compare(Object o1, Object o2) {
+        return compare((JPAAppCompany)o1, (JPAAppCompany)o2);
+    }
+
+    /** 
+     * 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(JPAAppCompany other) {
+        return compare(this, other);
+    }
+
+    /**
+     * Compares its two ICompany 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 ICompany object to be compared. 
+     * @param o2 the second ICompany 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(JPAAppCompany o1, JPAAppCompany o2) {
+        return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid());
+    }
+    
+    /** 
+     * 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 JPAAppCompany) {
+            return compareTo((JPAAppCompany)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 <code>Company</code> class. It consists of both the company 
+     * name and the date that the company was founded.
+     */
+    public static class Oid implements Serializable, Comparable {
+
+        /**
+         * This field is part of the identifier and should match in name
+         * and type with a field in the <code>Company</code> class.
+         */
+        public long companyid;
+
+        /** The required public no-arg constructor. */
+        public Oid() { }
+
+        /**
+         * Initialize the identifier.
+         * @param companyid The id of the company.
+         */
+        public Oid(long companyid) {
+            this.companyid = companyid;
+        }
+        
+        public Oid(String s) { companyid = Long.parseLong(justTheId(s)); }
+
+        public String toString() { return this.getClass().getName() + ": "  + companyid;}
+
+        
+        /** */
+        public boolean equals(Object obj) {
+            if (obj==null || !this.getClass().equals(obj.getClass())) 
+                return false;
+            Oid o = (Oid) obj;
+            if (this.companyid != o.companyid) 
+                return false;
+            return true;
+        }
+
+        /** */
+        public int hashCode() {
+            return (int)companyid;
+        }
+        
+        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( companyid < other.companyid ) return -1;
+            if( companyid > other.companyid ) return 1;
+            return 0;
+        }
+        
+    }
+
+}
+

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

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,131 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.persistence.*;
+
+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.EqualityHelper;
+
+/**
+ * This class represents a dental insurance carrier selection for a
+ * particular <code>Employee</code>.
+ */
+@Entity
+public class JPAAppDentalInsurance extends JPAAppInsurance
+    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 JPAAppDentalInsurance() {}
+
+    /**
+     * Construct a <code>DentalInsurance</code> instance.
+     * @param insid The insurance instance identifier.
+     * @param carrier The insurance carrier.
+     * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit.
+     */
+    public JPAAppDentalInsurance(long insid, String carrier, 
+                           BigDecimal lifetimeOrthoBenefit) {
+        super(insid, carrier);
+        this.lifetimeOrthoBenefit = lifetimeOrthoBenefit;
+    }
+
+    /**
+     * Construct a <code>JPAAppDentalInsurance</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 JPAAppDentalInsurance(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>JPAAppDentalInsurance</code>
+     * object.
+     * 
+     * 
+     * @return a String representation of a <code>JPAAppDentalInsurance</code>
+     * object.
+     */
+    public String toString() {
+        return "JPAAppDentalInsurance(" + 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) {
+        JPAAppDentalInsurance otherIns = (JPAAppDentalInsurance)other;
+        String where = "JPAAppDentalInsurance<" + 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/companyAnnotatedJPA/JPAAppDentalInsurance.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDepartment.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDepartment.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDepartment.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDepartment.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,435 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.persistence.*;
+
+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.
+ */
+@Entity
+@Table(name="departments")
+@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING,
+        name="DISCRIMINATOR")
+public class JPAAppDepartment
+    implements IDepartment, Serializable, Comparable, Comparator, DeepEquality {
+
+    public static final int RECOMMENDED_NO_OF_EMPS = 2;
+
+    @Id
+    @Column(name="ID")
+    private long deptid;
+    @Column(name="NAME")
+    private String  name;
+    @Column(name="COMPANYID")
+    private JPAAppCompany company;
+    @Column(name="EMP_OF_THE_MONTH")
+    private JPAAppEmployee employeeOfTheMonth;
+    @OneToMany(mappedBy="department",
+        targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class)
+    private Set employees = new HashSet();
+    @OneToMany(mappedBy="fundingDept",
+        targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class)
+    private Set fundedEmps = new HashSet();
+
+    /** This is the JDO-required no-args constructor. The TCK relies on
+     * this constructor for testing PersistenceManager.newInstance(PCClass).
+     */
+    public JPAAppDepartment() {}
+
+    /**
+     * Construct a <code>Department</code> instance.
+     * @param deptid The department id.
+     * @param name The name of the department.
+     */
+    public JPAAppDepartment(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 JPAAppDepartment(long deptid, String name, ICompany company) {
+        this.deptid = deptid;
+        this.name = name;
+        this.company = (JPAAppCompany)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 JPAAppDepartment(long deptid, String name, ICompany company, 
+                      IEmployee employeeOfTheMonth) {
+        this.deptid = deptid;
+        this.name = name;
+        this.company = (JPAAppCompany)company;
+        this.employeeOfTheMonth = (JPAAppEmployee)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 = (JPAAppCompany)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 = (JPAAppEmployee)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(JPAAppEmployee emp) {
+        employees.add(emp);
+    }
+
+    /**
+     * Remove an employee from the department.
+     * @param emp The employee to remove from the department.
+     */
+    public void removeEmployee(JPAAppEmployee 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(JPAAppEmployee 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(JPAAppEmployee 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 JPAAppDepartment.
+     * 
+     * 
+     * @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) {
+        JPAAppDepartment otherDept = (JPAAppDepartment)other;
+        String where = "JPADepartment<" + 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>JPAAppDepartment</code> object.
+     * 
+     * 
+     * @return a String representation of a <code>JPAAppDepartment</code> object.
+     */
+    public String toString() {
+        return "JPADepartment(" + 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((JPAAppDepartment)o);
+    }
+
+    /** 
+     * Compare two instances. This is a method in Comparator.
+     */
+    public int compare(Object o1, Object o2) {
+        return compare((JPAAppDepartment)o1, (JPAAppDepartment)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(JPAAppDepartment 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(JPAAppDepartment o1, JPAAppDepartment 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 JPAAppDepartment) {
+            return compareTo((JPAAppDepartment)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/companyAnnotatedJPA/JPAAppDepartment.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppEmployee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppEmployee.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppEmployee.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppEmployee.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,519 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.persistence.*;
+
+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.EqualityHelper;
+
+/**
+ * This class represents an employee.
+ */
+@Entity
+@Table(name="employees")
+public abstract class JPAAppEmployee extends JPAAppPerson implements IEmployee {
+
+    @Column(name="HIREDATE")
+    @Temporal(TemporalType.DATE)
+    private Date             hiredate;
+    @Column(name="WEEKLYHOURS")
+    private double           weeklyhours;
+    @OneToOne(mappedBy="employee")
+    private JPAAppDentalInsurance  dentalInsurance;
+    @OneToOne(mappedBy="employee")
+    private JPAAppMedicalInsurance medicalInsurance;
+    @Column(name="DEPARTMENT")
+    private JPAAppDepartment       department;
+    @Column(name="FUNDINGDEPT")
+    private JPAAppDepartment       fundingDept;
+    @Column(name="MANAGER")
+    private JPAAppEmployee         manager;
+    @Column(name="MENTOR")
+    private JPAAppEmployee         mentor;
+    @OneToOne(mappedBy="mentor")
+    private JPAAppEmployee         protege;
+    @Column(name="HRADVISOR")
+    private JPAAppEmployee         hradvisor;
+    @ManyToMany(mappedBy="reviewers",
+        targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class)
+    private Set reviewedProjects = new HashSet();
+    @ManyToMany(mappedBy="members",
+        targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class)
+    private Set projects = new HashSet();
+    @OneToMany(mappedBy="manager",
+        targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class)
+    private Set team = new HashSet();
+    @OneToMany(mappedBy="hradvisor",
+        targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class)
+    private Set hradvisees = new HashSet();
+
+    /** This is the JDO-required no-args constructor */
+    protected JPAAppEmployee() {}
+
+    /**
+     * Construct an <code>JPAAppEmployee</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 JPAAppEmployee(long personid, String firstname, String lastname, 
+                    String middlename, Date birthdate,
+                    Date hiredate) {
+        super(personid, firstname, lastname, middlename, birthdate);
+        this.hiredate = hiredate;
+    }
+
+    /**
+     * Construct an <code>JPAAppEmployee</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 JPAAppEmployee(long personid, String firstname, String lastname, 
+                    String middlename, Date birthdate, IAddress address,
+                    Date hiredate) {
+        super(personid, firstname, lastname, middlename, birthdate,
+                (JPAAppAddress)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(JPAAppProject project) {
+        reviewedProjects.add(project);
+    }
+
+    /**
+     * Remove a reviewed project.
+     * @param project A reviewed project.
+     */
+    public void removeReviewedProject(JPAAppProject 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(JPAAppProject project) {
+        projects.add(project);
+    }
+
+    /**
+     * Remove a project from an employee's set of projects.
+     * @param project The project.
+     */
+    public void removeProject(JPAAppProject 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 = (JPAAppDentalInsurance)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 = (JPAAppMedicalInsurance)medicalInsurance;
+    }
+
+    /**
+     * Get the employee's department.
+     * @return The department associated with the employee.
+     */
+    public IDepartment getDepartment() {
+        return department;
+    }
+
+    /**
+     * Set the employee's department.
+     * @param department The department.
+     */
+    public void setDepartment(IDepartment department) {
+        this.department = (JPAAppDepartment)department;
+    }
+
+    /**
+     * Get the employee's funding department.
+     * @return The funding department associated with the employee.
+     */
+    public IDepartment getFundingDept() {
+        return fundingDept;
+    }
+
+    /**
+     * Set the employee's funding department.
+     * @param department The funding department.
+     */
+    public void setFundingDept(IDepartment department) {
+        this.fundingDept = (JPAAppDepartment)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 = (JPAAppEmployee)manager;
+    }
+
+    /**
+     * Get the employee's team.
+     * 
+     * 
+     * @return The set of <code>JPAAppEmployee</code>s on this employee's team,
+     * returned as an unmodifiable set.
+     */
+    public Set getTeam() {
+        return Collections.unmodifiableSet(team);
+    }
+
+    /**
+     * Add an <code>JPAAppEmployee</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>JPAAppEmployee</code> to add to the team.
+     */
+    public void addToTeam(JPAAppEmployee emp) {
+        team.add(emp);
+        emp.manager = this;
+    }
+
+    /**
+     * Remove an <code>JPAAppEmployee</code> from this employee's team.
+     * This method will also set the <code>emp</code> manager to null.
+     * 
+     * 
+     * @param emp The <code>JPAAppEmployee</code> to remove from the team.
+     */
+    public void removeFromTeam(JPAAppEmployee emp) {
+        team.remove(emp);
+        emp.manager = null;
+    }
+
+    /**
+     * Set the employee's team.
+     * 
+     * 
+     * @param team The set of <code>JPAAppEmployee</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 = (JPAAppEmployee)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 = (JPAAppEmployee)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 = (JPAAppEmployee)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>JPAAppEmployee</code>s that are HR advisees of this employee.
+     */
+    public Set getHradvisees() {
+        return Collections.unmodifiableSet(hradvisees);
+    }
+
+    /**
+     * Add an <code>JPAAppEmployee</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(JPAAppEmployee emp) {
+        hradvisees.add(emp);
+        emp.hradvisor = this;
+    }
+
+    /**
+     * Remove an <code>JPAAppEmployee</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(JPAAppEmployee emp) {
+        hradvisees.remove(emp);
+        emp.hradvisor = null;
+    }
+
+    /**
+     * Set the HR advisees of this HR advisor.
+     * 
+     * 
+     * @param hradvisees The <code>JPAAppEmployee</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>JPAAppEmployee</code> object.
+     * 
+     * 
+     * @return a String representation of a <code>JPAAppEmployee</code> object.
+     */
+    public String toString() {
+        return "JPAAPPEmployee(" + 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 JPAAppEmployee.
+     * 
+     * 
+     * @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) {
+        JPAAppEmployee otherEmp = (JPAAppEmployee)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/companyAnnotatedJPA/JPAAppEmployee.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java?rev=582405&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java (added)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java Fri Oct  5 14:38:26 2007
@@ -0,0 +1,138 @@
+/*
+ * 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.companyAnnotatedJPA;
+
+import javax.persistence.*;
+
+import java.util.Date;
+import org.apache.jdo.tck.pc.company.IAddress;
+
+import org.apache.jdo.tck.pc.company.IFullTimeEmployee;
+import org.apache.jdo.tck.util.EqualityHelper;
+
+/**
+ * This class represents a full-time employee.
+ */
+@Entity
+public class JPAAppFullTimeEmployee extends JPAAppEmployee
+        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 JPAAppFullTimeEmployee() {}
+
+    /**
+     * 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 JPAAppFullTimeEmployee(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 JPAAppFullTimeEmployee(long personid, String first, String last,
+                            String middle, Date born, IAddress addr, 
+                            Date hired, double sal) {
+        super(personid, first, last, middle, born, (JPAAppAddress)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>JPAAppFullTimeEmployee</code> object.
+     * 
+     * 
+     * @return a String representation of a <code>JPAAppFullTimeEmployee</code> object.
+     */
+    public String toString() {
+        return "JPAAppFullTimeEmployee(" + 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
+     * JPAAppFullTimeEmployee. 
+     * 
+     * 
+     * @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) {
+        JPAAppFullTimeEmployee otherEmp = (JPAAppFullTimeEmployee)other;
+        String where = "JPAAppFullTimeEmployee<" + 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/companyAnnotatedJPA/JPAAppFullTimeEmployee.java
------------------------------------------------------------------------------
    svn:eol-style = LF



Mime
View raw message