Index: test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java	(revision 0)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java	(revision 0)
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.company;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * CompanyFactoryPersistentInterface.java
+ *
+ * Created on August 29, 2005, 7:42 PM
+ *
+ */
+public abstract class CompanyFactoryAbstractImpl implements CompanyFactory {
+    
+    protected PersistenceManager pm;
+    
+    /** Creates a new instance of CompanyFactoryAbstractImpl */
+    public CompanyFactoryAbstractImpl(PersistenceManager pm) {
+        this.pm = pm;
+    }
+
+    abstract IAddress newAddress();
+    abstract ICompany newCompany();
+    abstract IDentalInsurance newDentalInsurance();
+    abstract IDepartment newDepartment();
+    abstract IFullTimeEmployee newFullTimeEmployee();
+    abstract IMedicalInsurance newMedicalInsurance();
+    abstract IPartTimeEmployee newPartTimeEmployee();
+    abstract IProject newProject();
+    
+    public IAddress newAddress(long addrid, String street, String city, String state, String zipcode, String country) {
+        IAddress result = newAddress();
+        result.setAddrid(addrid);
+        result.setStreet(street);
+        result.setCity(city);
+        result.setState(state);
+        result.setZipcode(zipcode);
+        result.setCountry(country);
+        return result;
+    }
+
+    public ICompany newCompany(long companyid, String name, java.util.Date founded) {
+        ICompany result = newCompany();
+        result.setCompanyid(companyid);
+        result.setName(name);
+        result.setFounded(founded);
+        return result;
+    }
+
+    public ICompany newCompany(long companyid, String name, java.util.Date founded, IAddress addr) {
+        ICompany result = newCompany();
+        result.setCompanyid(companyid);
+        result.setName(name);
+        result.setFounded(founded);
+        result.setAddress(addr);
+        return result;
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, String carrier, java.math.BigDecimal lifetimeOrthoBenefit) {
+        IDentalInsurance result = newDentalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setLifetimeOrthoBenefit(lifetimeOrthoBenefit);
+        return null;
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, String carrier, IEmployee employee, java.math.BigDecimal lifetimeOrthoBenefit) {
+        IDentalInsurance result = newDentalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setEmployee(employee);
+        result.setLifetimeOrthoBenefit(lifetimeOrthoBenefit);
+        return result;
+    }
+
+    public IDepartment newDepartment(long deptid, String name) {
+        IDepartment result = newDepartment();
+        result.setDeptid(deptid);
+        result.setName(name);
+        return result;
+    }
+
+    public IDepartment newDepartment(long deptid, String name, ICompany company) {
+        IDepartment result = newDepartment();
+        result.setDeptid(deptid);
+        result.setName(name);
+        result.setCompany(company);
+        return result;
+    }
+
+    public IDepartment newDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) {
+        IDepartment result = newDepartment();
+        result.setDeptid(deptid);
+        result.setName(name);
+        result.setCompany(company);
+        result.setEmployeeOfTheMonth(employeeOfTheMonth);
+        return result;
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double sal) {
+        IFullTimeEmployee result = newFullTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setHiredate(hired);
+        result.setSalary(sal);
+        return result;
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double sal) {
+        IFullTimeEmployee result = newFullTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setAddress(addr);
+        result.setHiredate(hired);
+        result.setSalary(sal);
+        return result;
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, String carrier, String planType) {
+        IMedicalInsurance result = newMedicalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setPlanType(planType);
+        return result;
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) {
+        IMedicalInsurance result = newMedicalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setEmployee(employee);
+        result.setPlanType(planType);
+        return result;
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double wage) {
+        IPartTimeEmployee result = newPartTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setHiredate(hired);
+        result.setWage(wage);
+        return result;
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double wage) {
+        IPartTimeEmployee result = newPartTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setAddress(addr);
+        result.setHiredate(hired);
+        result.setWage(wage);
+        return result;
+    }
+
+    public IProject newProject(long projid, String name, java.math.BigDecimal budget) {
+        IProject result = newProject();
+        result.setProjid(projid);
+        result.setName(name);
+        result.setBudget(budget);
+        return result;
+    }
+    
+}
Index: test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java	(revision 0)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java	(revision 0)
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.company;
+
+import java.math.BigDecimal;
+
+import java.util.Date;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * CompanyFactoryConcreteClass.java
+ *
+ * Created on September 4, 2005, 4:31 PM
+ *
+ */
+public  class CompanyFactoryConcreteClass implements CompanyFactory {
+
+    public CompanyFactoryConcreteClass(PersistenceManager pm) {
+    }
+
+    public CompanyFactoryConcreteClass() {
+    }
+
+    public ICompany newCompany(long companyid, 
+            String name, Date founded) {
+        return new Company(companyid, name, founded);
+    }
+
+    public ICompany newCompany(long companyid, 
+            String name, Date founded, IAddress addr) {
+        return new Company(companyid, name, founded, addr);
+    }
+
+    public IAddress newAddress(long addrid, 
+            String street, String city, String state, String zipcode, 
+            String country) {
+        return new Address(addrid, street, city, state, zipcode, country);
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, 
+            String carrier, BigDecimal lifetimeOrthoBenefit) {
+        return new DentalInsurance(insid, carrier, lifetimeOrthoBenefit);
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, 
+            String carrier, IEmployee employee,
+            BigDecimal lifetimeOrthoBenefit) {
+        return new DentalInsurance(insid, carrier, lifetimeOrthoBenefit);
+    }
+
+    public IDepartment newDepartment(long deptid, String name) {
+        return new Department(deptid, name);
+    }
+
+    public IDepartment newDepartment(long deptid, 
+            String name, ICompany company) {
+        return new Department(deptid, name, company);
+    }
+
+    public IDepartment newDepartment(long deptid, 
+            String name, ICompany company, IEmployee employeeOfTheMonth) {
+        return new Department(deptid, name, company, employeeOfTheMonth);
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double sal) {
+        return new FullTimeEmployee(personid, first, last, middle,
+                born, hired, sal);
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, IAddress addr, Date hired, double sal) {
+        return new FullTimeEmployee(personid, first, last, middle,
+                born, addr, hired, sal);
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, 
+            String carrier, String planType) {
+        return new MedicalInsurance(insid, carrier, planType);
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, 
+            String carrier, IEmployee employee, String planType) {
+        return new MedicalInsurance(insid, carrier, planType);
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double wage ) {
+        return new PartTimeEmployee(personid, first, last, middle,
+                born, hired, wage);
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, IAddress addr, Date hired, double wage) {
+        return new PartTimeEmployee(personid, first, last, middle, 
+                born, addr, hired, wage);
+    } 
+
+    public IPerson newPerson(long personid, 
+            String firstname, String lastname, String middlename, 
+            Date birthdate) {
+        return new Person(personid, firstname, lastname, middlename,
+                birthdate);
+    }
+
+    public IPerson newPerson(long personid, 
+            String firstname, String lastname, String middlename, 
+            Date birthdate, IAddress address) {
+        return new Person(personid, firstname, lastname, middlename, 
+                birthdate, address);
+    }
+
+    public IProject newProject(long projid, String name, 
+            BigDecimal budget) {
+        return new Project(projid, name, budget);
+    }
+}
Index: test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java	(revision 278628)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java	(working copy)
@@ -107,6 +107,7 @@
         CustomDateEditor dateEditor = 
             new CustomDateEditor(formatter, true);
         registerCustomEditor(Date.class, dateEditor);
+        addSingleton("companyFactory", CompanyFactoryRegistry.getInstance());
     }
     
     // Convenience methods
Index: test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java	(revision 0)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java	(revision 0)
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.company;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * CompanyFactoryPMInterface.java
+ *
+ * Created on August 29, 2005, 9:56 PM
+ *
+ */
+public class CompanyFactoryPMInterface 
+        extends CompanyFactoryAbstractImpl {
+    
+    /**
+     * Creates a new instance of CompanyFactoryPMInterface 
+     */
+    public CompanyFactoryPMInterface(PersistenceManager pm) {
+        super(pm);
+    }
+    
+    IAddress newAddress() {
+        return (IAddress)pm.newInstance(IAddress.class);
+    }
+    
+    ICompany newCompany() {
+        return (ICompany)pm.newInstance(ICompany.class);
+    }
+    
+    IDentalInsurance newDentalInsurance() {
+        return (IDentalInsurance)pm.newInstance(IDentalInsurance.class);
+    }
+    
+    IDepartment newDepartment() {
+        return (IDepartment)pm.newInstance(IDepartment.class);
+    }
+    
+    IFullTimeEmployee  newFullTimeEmployee() {
+        return (IFullTimeEmployee)pm.newInstance(IFullTimeEmployee.class);
+    }
+    
+    IMedicalInsurance newMedicalInsurance() {
+        return (IMedicalInsurance)pm.newInstance(IMedicalInsurance.class);        
+    }
+    
+    IPartTimeEmployee  newPartTimeEmployee() {
+        return (IPartTimeEmployee)pm.newInstance(IPartTimeEmployee.class);
+    }
+    
+    IProject newProject() {
+        return (IProject)pm.newInstance(IProject.class);
+    }
+
+}
Index: test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java	(revision 0)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java	(revision 0)
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed 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.company;
+
+import java.lang.reflect.Constructor;
+
+import java.math.BigDecimal;
+
+import java.util.Date;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * This is the registry for company factories. 
+ */
+public class CompanyFactoryRegistry {
+
+    /**
+     * This is the default company factory.
+     */
+    static CompanyFactory singleton = new CompanyFactoryConcreteClass();
+    
+    /** 
+     * This is the currently registered factory.
+     */
+    static CompanyFactory instance = singleton;
+    
+    /**
+     * Creates a new instance of CompanyFactoryRegistry 
+     */
+    private CompanyFactoryRegistry() {
+    }
+    
+    public static CompanyFactory getInstance() {
+        return instance;
+    }
+    
+    public static void registerFactory(CompanyFactory factory) {
+        instance = factory!=null?factory:singleton;
+    }
+
+    public static void registerFactory(String factoryName, 
+            PersistenceManager pm) {
+        CompanyFactory factory = null;
+        try {
+            if (factoryName != null) {
+                Class factoryClass = Class.forName(factoryName);
+                Constructor ctor = factoryClass.getConstructor(new Class[]
+                    {PersistenceManager.class});
+                factory = (CompanyFactory)
+                    ctor.newInstance(new Object[]{pm});
+            }
+            registerFactory(factory);
+        } catch (Exception ex) {
+            throw new RuntimeException ("Unable to construct CompanyFactory " +
+                    factoryName, ex);
+        }
+    }
+
+}
Index: test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java	(revision 0)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java	(revision 0)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+ 
+/*
+ * CompanyFactory.java
+ *
+ */
+
+package org.apache.jdo.tck.pc.company;
+
+import java.math.BigDecimal;
+
+import java.util.Date;
+
+/**
+ * This interface is implemented by a factory class that can create 
+ * Company model instances. The factory instance is registered with 
+ * CompanyFactoryImpl.
+ */
+public interface CompanyFactory {
+    ICompany newCompany(long companyid, String name, Date founded);
+    ICompany newCompany(long companyid, String name, Date founded, 
+            IAddress addr);
+    IAddress newAddress(long addrid, String street, String city, 
+            String state, String zipcode, String country);
+    IDentalInsurance newDentalInsurance(long insid, String carrier, 
+            BigDecimal lifetimeOrthoBenefit);
+    IDentalInsurance newDentalInsurance(long insid, String carrier, 
+            IEmployee employee, BigDecimal lifetimeOrthoBenefit);
+    IDepartment newDepartment(long deptid, String name);
+    IDepartment newDepartment(long deptid, 
+            String name, ICompany company);
+    IDepartment newDepartment(long deptid, 
+            String name, ICompany company, 
+            IEmployee employeeOfTheMonth);
+    IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, IAddress addr, Date hired, double sal);
+    IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double sal);
+    IMedicalInsurance newMedicalInsurance(long insid, String carrier, 
+            String planType);
+    IMedicalInsurance newMedicalInsurance(long insid, String carrier, 
+            IEmployee employee, String planType);
+    IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double wage);
+    IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle,
+            Date born, IAddress addr, Date hired, double wage); 
+    IProject newProject(long projid, String name, BigDecimal budget);
+}
Index: test/java/org/apache/jdo/tck/mapping/CompletenessTest.java
===================================================================
--- test/java/org/apache/jdo/tck/mapping/CompletenessTest.java	(revision 278628)
+++ test/java/org/apache/jdo/tck/mapping/CompletenessTest.java	(working copy)
@@ -16,12 +16,21 @@
 
 package org.apache.jdo.tck.mapping;
 
+import java.lang.reflect.Constructor;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.jdo.PersistenceManager;
+import javax.jdo.JDOException;
+
 import org.apache.jdo.tck.JDO_Test;
+
+import org.apache.jdo.tck.pc.company.CompanyFactory;
+import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
+
 import org.apache.jdo.tck.util.BatchTestRunner;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
@@ -49,6 +58,9 @@
     
     protected String inputFilename = System.getProperty("jdo.tck.testdata");
     
+    protected String factoryName = 
+            System.getProperty("jdo.tck.mapping.companyfactory");
+    
     /**
      * The <code>main</code> is called when the class
      * is directly executed from the command line.
@@ -62,9 +74,10 @@
      * @see JDO_Test#localSetUp()
      */
     protected void localSetUp() {
+        getPM();
+        CompanyFactoryRegistry.registerFactory(factoryName, pm);
         CompanyModelReader reader = new CompanyModelReader(inputFilename);
         // persist test data
-        getPM();
         pm.currentTransaction().begin();
         List rootList = reader.getRootList();
         pm.makePersistentAll(rootList);
@@ -82,6 +95,7 @@
     public void test() {
         
         // get new obj graph
+        CompanyFactoryRegistry.registerFactory(null);
         CompanyModelReader reader = new CompanyModelReader(inputFilename);
         List rootList = reader.getRootList();
         
@@ -110,7 +124,8 @@
         pm.currentTransaction().commit();
         // fail test if at least one of the instances is not the expected one
         if (msg.length() > 0) {
-            fail("CompletenessTest failed; see list of failed instances below:", msg.toString());
+            fail("CompletenessTest failed; see list of failures below:", 
+                    msg.toString());
         }
     }
 }
Index: test/conf/derby.properties
===================================================================
--- test/conf/derby.properties	(revision 278628)
+++ test/conf/derby.properties	(working copy)
@@ -1,5 +1,5 @@
 # This flag must be set on Mac OSX
-#derby.storage.fileSyncTransactionLog=true
+derby.storage.fileSyncTransactionLog=true
 
 #When this property is set to true, Derby writes the query plan information 
 #into the derby.log file for all executed queries.
Index: test/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml
===================================================================
--- test/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml	(revision 278628)
+++ test/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml	(working copy)
@@ -26,23 +26,27 @@
         </constructor-arg>
     </bean>
 
-    <bean id="company1" class="org.apache.jdo.tck.pc.company.Company">
+    <bean id="company1" factory-bean="companyFactory"
+            factory-method="newCompany">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Sun Microsystems, Inc.</value></constructor-arg>
         <constructor-arg index="2" type="java.util.Date"><value>11/Apr/1952</value></constructor-arg>
     </bean>
 
-    <bean id="dept1" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept1" factory-bean="companyFactory"
+            factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Development</value></constructor-arg>
     </bean>
 
-    <bean id="dept2" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept2" factory-bean="companyFactory"
+            factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Human Resources</value></constructor-arg>
     </bean>
 
-    <bean id="emp1" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp1" factory-bean="companyFactory"
+            factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp1First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp1Last</value></constructor-arg>
@@ -52,7 +56,8 @@
         <constructor-arg index="6" type="double"><value>20000</value></constructor-arg>
         <property name="weeklyhours"><value>40</value></property>
     </bean>
-    <bean id="emp2" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp2" factory-bean="companyFactory"
+            factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp2First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp2Last</value></constructor-arg>
@@ -62,7 +67,8 @@
         <constructor-arg index="6" type="double"><value>10000</value></constructor-arg>
         <property name="weeklyhours"><value>40</value></property>
     </bean>
-    <bean id="emp3" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp3" factory-bean="companyFactory"
+            factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp3First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp3Last</value></constructor-arg>
@@ -72,7 +78,8 @@
         <constructor-arg index="6" type="double"><value>15000</value></constructor-arg>
         <property name="weeklyhours"><value>19</value></property>
     </bean>
-    <bean id="emp4" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp4" factory-bean="companyFactory"
+            factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp4First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp4Last</value></constructor-arg>
@@ -81,7 +88,8 @@
         <constructor-arg index="5" type="java.util.Date"><value>15/Apr/2001</value></constructor-arg>
         <constructor-arg index="6" type="double"><value>13000</value></constructor-arg>
     </bean>
-    <bean id="emp5" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp5" factory-bean="companyFactory"
+            factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp5First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp5Last</value></constructor-arg>
@@ -91,41 +99,48 @@
         <constructor-arg index="6" type="double"><value>45000</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns1" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns1" factory-bean="companyFactory"
+            factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>PPO</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns2" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns2" factory-bean="companyFactory"
+            factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns3" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns3" factory-bean="companyFactory"
+            factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
     </bean>
 
-    <bean id="dentalIns1" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns1" factory-bean="companyFactory"
+            factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
     </bean>
 
-    <bean id="proj1" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj1" factory-bean="companyFactory"
+            factory-method="newProject">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>orange</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2500000.99</value></constructor-arg>
     </bean>
-    <bean id="proj2" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj2" factory-bean="companyFactory"
+            factory-method="newProject">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>blue</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>50000.00</value></constructor-arg>
     </bean>
-    <bean id="proj3" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj3" factory-bean="companyFactory"
+            factory-method="newProject">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>green</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2000.99</value></constructor-arg>
