Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCFullTimeEmployee.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCFullTimeEmployee.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCFullTimeEmployee.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCFullTimeEmployee.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,81 @@ +/* + * 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. + */ + +/* + * PCFullTimeEmployee.java + * + * Created on May 22, 2001, 9:36 AM + */ + +package org.apache.jdo.pc.empdept; + +/** + * + * @author clr + * @version + */ +public class PCFullTimeEmployee extends PCEmployee { + + public double salary; + + /** Creates new PCFullTimeEmployee */ + public PCFullTimeEmployee() { + } + public PCFullTimeEmployee( + String _first, + String _last, + java.util.Date _born, + long _empid, + java.util.Date _hired, + double _sal ) { + super (_first, _last, _born, _empid, _hired, null, null, null, null, null); + salary = _sal; + } + + public double getSalary() { + return salary; + } + + public void setSalary(double salary) { + this.salary = salary; + } + + public String toString() { + StringBuffer rc = new StringBuffer("PCFullTimeEmployee: "); +// rc.append(lastname); +// rc.append(", " + firstname); + rc.append(super.toString()); +// rc.append(", id=" + empid); +// rc.append(", born " + formatter.format(birthdate)); +// rc.append(", hired " + formatter.format(hiredate)); + rc.append(" $" + salary); +// String mgrName = "none"; +// if (null != manager) { +// mgrName = manager.getLastname(); +// } +// rc.append(" manager: " + mgrName); +// rc.append(" dept: " + department.getName()); +// int numEmps = 0; +// if (null != employees) { +// numEmps = employees.size(); +// } +// rc.append(" emps: " + numEmps); +// rc.append(" insurance: " + insurance.getCarrier()); + return rc.toString(); + } + + +}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCInsurance.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCInsurance.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCInsurance.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCInsurance.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,92 @@ +/* + * 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.pc.empdept; + +import java.util.HashSet; + +/** +* A sample insurance class, generated from an SQL schema. +*/ +public class PCInsurance implements java.io.Serializable{ + public long insid; + + public String carrier; + + public org.apache.jdo.pc.empdept.PCEmployee employee; + + public String toString() { + return "Ins: " + carrier + ", id=" + insid + + ", emp " + employee.getLastname(); + } + + public PCInsurance() { + } + + public PCInsurance(long _id, String _carrier, PCEmployee _emp) { + insid = _id; + carrier = _carrier; + employee = _emp; + } + + public long getInsid() { + return insid; + } + + public void setInsid(long insid) { + this. insid = insid; + } + + public String getCarrier() { + return carrier; + } + + public void setCarrier(String carrier) { + this. carrier = carrier; + } + + public PCEmployee getEmployee() { + return employee; + } + + public void setEmployee(PCEmployee employee) { + this. employee = employee; + } + + public static class Oid { + public long insid; + + public Oid() { + } + + public boolean equals(java.lang.Object obj) { + if( obj==null || + !this.getClass().equals(obj.getClass()) ) return( false ); + Oid o=(Oid) obj; + if( this.insid!=o.insid ) return( false ); + return( true ); + } + + public int hashCode() { + int hashCode=0; + hashCode += insid; + return( hashCode ); + } + + +} +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPartTimeEmployee.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPartTimeEmployee.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPartTimeEmployee.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPartTimeEmployee.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,80 @@ +/* + * 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. + */ + +/* + * PCPartTimeEmployee.java + * + * Created on May 22, 2001, 9:35 AM + */ + +package org.apache.jdo.pc.empdept; + +/** + * + * @author clr + * @version + */ +public class PCPartTimeEmployee extends PCEmployee { + + public double wage; + + /** Creates new PCPartTimeEmployee */ + public PCPartTimeEmployee() { + } + public PCPartTimeEmployee( + String _first, + String _last, + java.util.Date _born, + long _empid, + java.util.Date _hired, + double _wage ) { + super (_first, _last, _born, _empid, _hired, null, null, null, null, null); + wage = _wage; + } + + public double getWage() { + return wage; + } + + public void setWage(double wage) { + this.wage = wage; + } + + public String toString() { + StringBuffer rc = new StringBuffer("PCPartTimeEmployee: "); +// rc.append(lastname); +// rc.append(", " + firstname); + rc.append(super.toString()); +// rc.append(", id=" + empid); +// rc.append(", born " + formatter.format(birthdate)); +// rc.append(", hired " + formatter.format(hiredate)); + rc.append(" $" + wage); +// String mgrName = "none"; +// if (null != manager) { +// mgrName = manager.getLastname(); +// } +// rc.append(" manager: " + mgrName); +// rc.append(" dept: " + department.getName()); +// int numEmps = 0; +// if (null != employees) { +// numEmps = employees.size(); +// } +// rc.append(" emps: " + numEmps); +// rc.append(" insurance: " + insurance.getCarrier()); + return rc.toString(); + } + +} Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPerson.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPerson.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPerson.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCPerson.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,107 @@ +/* + * 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. + */ + +/* + * PCPerson.java + * + * Created on May 22, 2001, 9:34 AM + */ + +package org.apache.jdo.pc.empdept; + +import java.text.SimpleDateFormat; +import java.util.TimeZone; +import java.util.Locale; + +/** + * + * @author clr + * @version + */ +public class PCPerson implements java.io.Serializable{ + + public String firstname; + + public String lastname; + + public java.util.Date birthdate; + + protected static SimpleDateFormat formatter; + + static { + formatter = new SimpleDateFormat("d/MMM/yyyy", Locale.US); + formatter.setTimeZone(TimeZone.getTimeZone("America/New_York")); + } + + /** Creates new PCPerson */ + + public PCPerson() { + } + + public PCPerson(String firstname, String lastname, java.util.Date birthdate) { + this.firstname = firstname; + this.lastname = lastname; + this.birthdate = birthdate; + } + + public String getLastname() { + return lastname; + } + + public void setLastname(String lastname) { + this. lastname = lastname; + } + + public String getFirstname() { + return firstname; + } + + public void setFirstname(String firstname) { + this. firstname = firstname; + } + + public java.util.Date getBirthdate() { + return birthdate; + } + + public void setBirthdate(java.util.Date birthdate) { + this. birthdate = birthdate; + } + + + public String toString() { + StringBuffer rc = new StringBuffer("PCPerson: "); + rc.append(getLastname()); + rc.append(", " + getFirstname()); +// rc.append(", id=" + empid); + rc.append(", born " + formatter.format(getBirthdate())); +// rc.append(", hired " + formatter.format(hiredate)); +// rc.append(" $" + salary); +// String mgrName = "none"; +// if (null != manager) { +// mgrName = manager.getLastname(); +// } +// rc.append(" manager: " + mgrName); +// rc.append(" dept: " + department.getName()); +// int numEmps = 0; +// if (null != employees) { +// numEmps = employees.size(); +// } +// rc.append(" emps: " + numEmps); +// rc.append(" insurance: " + insurance.getCarrier()); + return rc.toString(); + } +} Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCProject.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCProject.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCProject.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/PCProject.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,91 @@ +/* + * 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.pc.empdept; + +import java.util.HashSet; + +/** +* A sample project class, generated from an SQL schema. +*/ +public class PCProject implements java.io.Serializable{ + public long projid; + + public String name; + + public java.util.HashSet employees; + + public String toString() { + return "PCProject: " + name + ", id=" + projid + + ", emps: " + employees.size(); + } + + public PCProject() { + } + + public PCProject(long _projid, String _name) { + projid = _projid; + name = _name; + } + + public long getProjid() { + return projid; + } + + public void setProjid(long projid) { + this. projid = projid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this. name = name; + } + + public java.util.HashSet getEmployees() { + return employees; + } + + public void setEmployees(java.util.HashSet employees) { + this. employees = employees; + } + + public static class Oid { + public long projid; + + public Oid() { + } + + public boolean equals(java.lang.Object obj) { + if( obj==null || + !this.getClass().equals(obj.getClass()) ) return( false ); + Oid o=(Oid) obj; + if( this.projid!=o.projid ) return( false ); + return( true ); + } + + public int hashCode() { + int hashCode=0; + hashCode += projid; + return( hashCode ); + } + + +} +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/empdept.jdoproperties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/empdept.jdoproperties?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/empdept.jdoproperties (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/empdept.jdoproperties Fri Mar 18 17:02:29 2005 @@ -0,0 +1,45 @@ +# Classnames can have the following attributes: +# jdo:{persistent|transactional} +# super: <classname> +# oid: <classname> +# access: {public|protected|package|private} +# Fieldnames can have the following attributes: +# type:<type> +# access: {public|protected|package|private} +# jdo:{persistent|transactional|transient} +# annotation:{key|dfg|mediated} + +org.apache.jdo.pc.empdept.PCPerson=jdo:persistent +org.apache.jdo.pc.empdept.PCPerson#firstname=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCPerson#lastname=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCPerson#birthdate=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.empdept.PCEmployee=jdo:persistent,super:org.apache.jdo.pc.empdept.PCPerson +org.apache.jdo.pc.empdept.PCEmployee#empid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCEmployee#hiredate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCEmployee#department=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCEmployee#projects=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCEmployee#manager=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCEmployee#employees=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCEmployee#insurance=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.empdept.PCPartTimeEmployee=jdo:persistent,super:org.apache.jdo.pc.empdept.PCEmployee +org.apache.jdo.pc.empdept.PCPartTimeEmployee#wage=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.empdept.PCFullTimeEmployee=jdo:persistent,super:org.apache.jdo.pc.empdept.PCEmployee +org.apache.jdo.pc.empdept.PCFullTimeEmployee#salary=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.empdept.PCDepartment=jdo:persistent +org.apache.jdo.pc.empdept.PCDepartment#deptid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCDepartment#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCDepartment#employees=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.empdept.PCInsurance=jdo:persistent +org.apache.jdo.pc.empdept.PCInsurance#insid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCInsurance#carrier=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCInsurance#employee=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.empdept.PCProject=jdo:persistent +org.apache.jdo.pc.empdept.PCProject#projid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCProject#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.empdept.PCProject#employees=jdo:persistent,annotation:mediated Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/package.jdo URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/package.jdo?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/package.jdo (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/empdept/package.jdo Fri Mar 18 17:02:29 2005 @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 1.0//EN" "http://java.sun.com/dtd/jdo_1_0.dtd"> +<jdo> + <package name="org.apache.jdo.pc.empdept"> + + <class name="PCPerson" + identity-type="datastore"> + <field name="firstname"/> + <field name="lastname"/> + <field name="birthdate"/> + </class> + + <class name="PCEmployee" + identity-type="datastore" + persistence-capable-superclass="PCPerson"> + <field name="empid"/> + <field name="hiredate"/> + <field name="department" persistence-modifier="persistent"/> + <field name="projects"> + <collection element-type="PCProject"/> + </field> + <field name="manager" persistence-modifier="persistent"/> + <field name="employees"> + <collection element-type="PCEmployee"/> + </field> + <field name="insurance" persistence-modifier="persistent"/> + </class> + + <class name="PCPartTimeEmployee" + identity-type="datastore" + persistence-capable-superclass="PCEmployee"> + <field name="wage"/> + </class> + + <class name="PCFullTimeEmployee" + identity-type="datastore" + persistence-capable-superclass="PCEmployee"> + <field name="salary"/> + </class> + + <class name="PCDepartment" + identity-type="datastore"> + <field name="deptid"/> + <field name="name"/> + <field name="employees"> + <collection element-type="PCEmployee"/> + </field> + </class> + + <class name="PCInsurance" + identity-type="datastore"> + <field name="insid"/> + <field name="carrier"/> + <field name="employee" persistence-modifier="persistent"/> + </class> + + <class name="PCProject" + identity-type="datastore"> + <field name="projid"/> + <field name="name"/> + <field name="employees"> + <collection element-type="PCEmployee"/> + </field> + </class> + + </package> +</jdo> + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/package.jdo URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/package.jdo?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/package.jdo (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/package.jdo Fri Mar 18 17:02:29 2005 @@ -0,0 +1,441 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + For testing purposes this .jdo file uses SYSTEM DOCTYPE, + where most of the other .jdo files use a PUBLIC DOCTYPE. +--> +<!DOCTYPE jdo SYSTEM "file:/javax/jdo/jdo.dtd"> +<!--DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 1.0//EN" "http://java.sun.com/dtd/jdo_1_0.dtd"--> +<jdo> + <package name="org.apache.jdo.pc"> + + <!-- This will not be required once the JDOModel is fixed so that + the defaults defined in section 18.4 of the spec are working + --> + <class name="PCPoint" + identity-type="datastore"> + <field name="x" persistence-modifier="persistent"/> + <field name="y" persistence-modifier="persistent"/> + </class> + + <class name="PCPoint1" + identity-type="application" objectid-class="org.apache.jdo.pc.PCPoint1Key"> + <field name="x" persistence-modifier="persistent" primary-key="true"/> + <field name="y" persistence-modifier="persistent"/> + </class> + + <!-- This will not be required once the JDOModel is fixed so that + the defaults defined in section 18.4 of the spec are working + --> + <class name="PCPrimitive" + identity-type="datastore"> + <field name="_boolean" persistence-modifier="persistent"/> + <field name="_char" persistence-modifier="persistent"/> + <field name="_byte" persistence-modifier="persistent"/> + <field name="_short" persistence-modifier="persistent"/> + <field name="_int" persistence-modifier="persistent"/> + <field name="_long" persistence-modifier="persistent"/> + <field name="_float" persistence-modifier="persistent"/> + <field name="_double" persistence-modifier="persistent"/> + <field name="_String" persistence-modifier="persistent"/> + <field name="_nullString" persistence-modifier="persistent"/> + <field name="_Boolean" persistence-modifier="persistent"/> + <field name="_nullBoolean" persistence-modifier="persistent"/> + <field name="_Char" persistence-modifier="persistent"/> + <field name="_nullChar" persistence-modifier="persistent"/> + <field name="_Byte" persistence-modifier="persistent"/> + <field name="_nullByte" persistence-modifier="persistent"/> + <field name="_Short" persistence-modifier="persistent"/> + <field name="_nullShort" persistence-modifier="persistent"/> + <field name="_Int" persistence-modifier="persistent"/> + <field name="_nullInt" persistence-modifier="persistent"/> + <field name="_Long" persistence-modifier="persistent"/> + <field name="_nullLong" persistence-modifier="persistent"/> + <field name="_Float" persistence-modifier="persistent"/> + <field name="_nullFloat" persistence-modifier="persistent"/> + <field name="_Double" persistence-modifier="persistent"/> + <field name="_nullDouble" persistence-modifier="persistent"/> + <field name="_Number" persistence-modifier="persistent"/> + <field name="_nullNumber" persistence-modifier="persistent"/> + </class> + + + + <!-- This will not be required once the JDOModel is fixed so that + the defaults defined in section 18.4 of the spec are working + --> + <class name="PCCollections" + identity-type="datastore"> + + <field name="_arrayList" persistence-modifier="persistent"/> + <field name="_emptyArrayList" persistence-modifier="persistent"/> + <field name="_nullArrayList" persistence-modifier="persistent"/> + + <field name="_sco_arrayList" persistence-modifier="persistent"/> + <field name="_sco_emptyArrayList" persistence-modifier="persistent"/> + <field name="_sco_nullArrayList" persistence-modifier="persistent"/> + + <field name="_vector" persistence-modifier="persistent"/> + <field name="_emptyVector" persistence-modifier="persistent"/> + <field name="_nullVector" persistence-modifier="persistent"/> + + <field name="_sco_vector" persistence-modifier="persistent"/> + <field name="_sco_emptyVector" persistence-modifier="persistent"/> + <field name="_sco_nullVector" persistence-modifier="persistent"/> + + <field name="_hashMap" persistence-modifier="persistent"/> + <field name="_emptyHashMap" persistence-modifier="persistent"/> + <field name="_nullHashMap" persistence-modifier="persistent"/> + + <field name="_sco_hashMap" persistence-modifier="persistent"/> + <field name="_sco_emptyHashMap" persistence-modifier="persistent"/> + <field name="_sco_nullHashMap" persistence-modifier="persistent"/> + + <field name="_hashtable" persistence-modifier="persistent"/> + <field name="_emptyHashtable" persistence-modifier="persistent"/> + <field name="_nullHashtable" persistence-modifier="persistent"/> + + <field name="_sco_hashtable" persistence-modifier="persistent"/> + <field name="_sco_emptyHashtable" persistence-modifier="persistent"/> + <field name="_sco_nullHashtable" persistence-modifier="persistent"/> + + <field name="_hashSet" persistence-modifier="persistent"/> + <field name="_emptyHashSet" persistence-modifier="persistent"/> + <field name="_nullHashSet" persistence-modifier="persistent"/> + + <field name="_sco_hashSet" persistence-modifier="persistent"/> + <field name="_sco_emptyHashSet" persistence-modifier="persistent"/> + <field name="_sco_nullHashSet" persistence-modifier="persistent"/> + + <field name="_linkedList" persistence-modifier="persistent"/> + <field name="_emptyLinkedList" persistence-modifier="persistent"/> + <field name="_nullLinkedList" persistence-modifier="persistent"/> + + <field name="_sco_linkedList" persistence-modifier="persistent"/> + <field name="_sco_emptyLinkedList" persistence-modifier="persistent"/> + <field name="_sco_nullLinkedList" persistence-modifier="persistent"/> + + <field name="_treeMap" persistence-modifier="persistent"/> + <field name="_emptyTreeMap" persistence-modifier="persistent"/> + <field name="_nullTreeMap" persistence-modifier="persistent"/> + + <field name="_sco_treeMap" persistence-modifier="persistent"/> + <field name="_sco_emptyTreeMap" persistence-modifier="persistent"/> + <field name="_sco_nullTreeMap" persistence-modifier="persistent"/> + + <field name="_treeSet" persistence-modifier="persistent"/> + <field name="_emptyTreeSet" persistence-modifier="persistent"/> + <field name="_nullTreeSet" persistence-modifier="persistent"/> + + <field name="_sco_treeSet" persistence-modifier="persistent"/> + <field name="_sco_emptyTreeSet" persistence-modifier="persistent"/> + <field name="_sco_nullTreeSet" persistence-modifier="persistent"/> + </class> + + + <class name="PCArrays" + identity-type="datastore"> + + <field name="_arrayListArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyArrayListArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullArrayListArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_hashMapArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyHashMapArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullHashMapArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_hashSetArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyHashSetArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullHashSetArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_hashtableArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyHashtableArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullHashtableArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_linkedListArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyLinkedListArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullLinkedListArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_treeMapArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyTreeMapArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullTreeMapArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_treeSetArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyTreeSetArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullTreeSetArray" persistence-modifier="persistent"> + <array/> + </field> + + <field name="_vectorArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_emptyVectorArray" persistence-modifier="persistent"> + <array/> + </field> + <field name="_nullVectorArray" persistence-modifier="persistent"> + <array/> + </field> + </class> + + + <!-- This will not be required once the JDOModel is fixed so that + the defaults defined in section 18.4 of the spec are working + --> + <class name="PCStroke" + identity-type="datastore"> + <field name="points" persistence-modifier="persistent"/> + </class> + + + <!-- This will not be required once the JDOModel is fixed so that + the defaults defined in section 18.4 of the spec are working + --> + <class name="PCLargeObj" + identity-type="datastore"> + <field name="x" persistence-modifier="persistent"> + <array/> + </field> + </class> + + + <class name="PCRect" + identity-type="datastore"> + <field name="lowerRight" persistence-modifier="persistent"/> + <field name="upperLeft" persistence-modifier="persistent"/> + </class> + + + <class name="PCRefArrays" + identity-type="datastore"> + <field name="_pcpointArray" persistence-modifier="persistent"> + <array/> + </field> + </class> + + + <class name="PCInterfaces" + identity-type="datastore"> + <field name="_list" persistence-modifier="persistent"/> + <field name="_emptyList" persistence-modifier="persistent"/> + <field name="_nullList" persistence-modifier="persistent"/> + </class> + + + <!-- These two models go together --> + + <class name="PCCycle" + identity-type="datastore"> + <field name="name" persistence-modifier="persistent"/> + <field name="c2" persistence-modifier="persistent"/> + </class> + + + <class name="PCCycle2" + identity-type="datastore"> + <field name="id" persistence-modifier="persistent"/> + <field name="c" persistence-modifier="persistent"/> + </class> + + + <!-- This is not required for the RI, which natively supports + java.sql.Date. Implementations that do otherwise + will need to uncomment out this part of this model. + + OK, so I'm a liar: there's a bug in the JDOModel implementation + which requires that we have XML for each and every field in each + and every PersistenceCapable class...in other words, we presently + cannot rely on the defaults specified in section 18.4 of the spec + --> + + <class name="PCSCO" + identity-type="datastore"> + <field name="_date" persistence-modifier="persistent"/> + <field name="_nullDate" persistence-modifier="persistent"/> + + <field name="_scoDate" persistence-modifier="persistent"/> + <field name="_nullSCODate" persistence-modifier="persistent"/> + + <field name="_sqlDate" persistence-modifier="persistent"/> + <field name="_nullSqlDate" persistence-modifier="persistent"/> + + <field name="_bigDecimal" persistence-modifier="persistent"/> + <field name="_nullBigDecimal" persistence-modifier="persistent"/> + + <field name="_bigInteger" persistence-modifier="persistent"/> + <field name="_nullBigInteger" persistence-modifier="persistent"/> + + <field name="_bitSet" persistence-modifier="persistent"/> + <field name="_nullBitSet" persistence-modifier="persistent"/> + + <field name="_locale" persistence-modifier="persistent"/> + <field name="_nullLocale" persistence-modifier="persistent"/> + </class> + +<!-- end of PCSCO --> + + + <!-- These four models go together --> + + <class name="PCDepartment" + identity-type="datastore"> + <field name="deptid" persistence-modifier="persistent"/> + <field name="name" persistence-modifier="persistent"/> + <field name="employees"> + <collection element-type="PCEmployee"/> + </field> + </class> + + <class name="PCEmployee" + identity-type="datastore"> + <field name="empid" persistence-modifier="persistent"/> + <field name="lastname" persistence-modifier="persistent"/> + <field name="firstname" persistence-modifier="persistent"/> + <field name="hiredate" persistence-modifier="persistent"/> + <field name="birthdate" persistence-modifier="persistent"/> + <field name="salary" persistence-modifier="persistent"/> + <field name="projects"> + <collection element-type="PCProject"/> + </field> + <field name="department" persistence-modifier="persistent"/> + <field name="manager" persistence-modifier="persistent"/> + <field name="employees"> + <collection element-type="PCEmployee"/> + </field> + <field name="insurance" persistence-modifier="persistent"/> + </class> + + + <class name="PCInsurance" + identity-type="datastore"> + <field name="insid" persistence-modifier="persistent"/> + <field name="carrier" persistence-modifier="persistent"/> + <field name="employee" persistence-modifier="persistent"/> + </class> + + + <class name="PCProject" + identity-type="datastore"> + <field name="projid" persistence-modifier="persistent"/> + <field name="name" persistence-modifier="persistent"/> + <field name="employees"> + <collection element-type="PCEmployee"/> + </field> + </class> + + <!-- These four models go together also --> + + <class name="PCDepartment1" + identity-type="datastore"> + <field name="deptid" persistence-modifier="persistent"/> + <field name="name" persistence-modifier="persistent"/> + <field name="employees"> + <collection element-type="PCEmployee1"/> + </field> + </class> + + <class name="PCEmployee1" + identity-type="datastore"> + <field name="empid" persistence-modifier="persistent"/> + <field name="lastname" persistence-modifier="persistent"/> + <field name="firstname" persistence-modifier="persistent"/> + <field name="hiredate" persistence-modifier="persistent"/> + <field name="birthdate" persistence-modifier="persistent"/> + <field name="salary" persistence-modifier="persistent"/> + <field name="projects"> + <collection element-type="PCProject1"/> + </field> + <field name="department" persistence-modifier="persistent"/> + <field name="manager" persistence-modifier="persistent"/> + <field name="employees" persistence-modifier="persistent"> + <array/> + </field> + <field name="insurance" persistence-modifier="persistent"/> + </class> + + <class name="PCFullTimeEmployee1" + identity-type="datastore" + persistence-capable-superclass="PCEmployee1"> + <field name="range"/> + </class> + + <class name="PCInsurance1" + identity-type="datastore"> + <field name="insid" persistence-modifier="persistent"/> + <field name="carrier" persistence-modifier="persistent"/> + <field name="employee" persistence-modifier="persistent"/> + </class> + + + <class name="PCProject1" + identity-type="datastore"> + <field name="projid" persistence-modifier="persistent"/> + <field name="name" persistence-modifier="persistent"/> + <field name="employees"> + <collection element-type="PCEmployee1"/> + </field> + </class> + + <class name="PCBase" + identity-type="datastore"> + <field name="s" persistence-modifier="persistent"/> + </class> + + <class name="PCDerived" + identity-type="datastore" + persistence-capable-superclass="PCBase"> + </class> + + <!-- PCId, PCCollection are Introduced + for regression testing bugid 4833532 --> + <class name="PCId" + identity-type="datastore"> + <field name="id" persistence-modifier="persistent"/> + </class> + + <class name="PCCollection" + identity-type="datastore"> + <field name="set" persistence-modifier="persistent"/> + </class> + + </package> +</jdo> + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/pc.jdoproperties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/pc.jdoproperties?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/pc.jdoproperties (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/pc.jdoproperties Fri Mar 18 17:02:29 2005 @@ -0,0 +1,401 @@ +# Classnames can have the following attributes: +# jdo:{persistent|transactional} +# super: <classname> +# oid: <classname> +# access: {public|protected|package|private} +# Fieldnames can have the following attributes: +# type:<type> +# access: {public|protected|package|private} +# jdo:{persistent|transactional|transient} +# annotation:{key|dfg|mediated} + +org.apache.jdo.pc.PCPoint=jdo:persistent +org.apache.jdo.pc.PCPoint#x=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPoint#y=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCPoint1=jdo:persistent,oid:org.apache.jdo.pc.PCPoint1Key +org.apache.jdo.pc.PCPoint1#x=jdo:persistent,annotation:key +org.apache.jdo.pc.PCPoint1#y=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCPrimitive=jdo:persistent +org.apache.jdo.pc.PCPrimitive#_boolean=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_char=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_byte=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_short=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_int=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_long=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_float=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_double=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_String=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullString=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Boolean=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullBoolean=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Char=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullChar=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Byte=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullByte=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Short=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullShort=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Int=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullInt=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Long=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullLong=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Float=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullFloat=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Double=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullDouble=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_Number=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCPrimitive#_nullNumber=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCCollections=jdo:persistent +org.apache.jdo.pc.PCCollections#_arrayList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyArrayList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullArrayList=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_arrayList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyArrayList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullArrayList=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_vector=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyVector=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullVector=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_vector=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyVector=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullVector=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_hashMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyHashMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullHashMap=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_hashMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyHashMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullHashMap=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_hashtable=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyHashtable=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullHashtable=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_hashtable=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyHashtable=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullHashtable=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_hashSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyHashSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullHashSet=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_hashSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyHashSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullHashSet=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_linkedList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyLinkedList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullLinkedList=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_linkedList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyLinkedList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullLinkedList=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_treeMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyTreeMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullTreeMap=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_treeMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyTreeMap=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullTreeMap=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_treeSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_emptyTreeSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_nullTreeSet=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#_sco_treeSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_emptyTreeSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollections#_sco_nullTreeSet=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollections#date=jdo:persistent,annotation:mediated +# +# End of PCCollection + +org.apache.jdo.pc.PCArrays=jdo:persistent +# boolean +org.apache.jdo.pc.PCArrays#_booleanArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyBooleanArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullBooleanArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_BooleanArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_BooleanArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_BooleanArray=jdo:persistent,annotation:mediated + +# char +org.apache.jdo.pc.PCArrays#_charArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyCharArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullCharArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_CharacterArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_CharacterArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_CharacterArray=jdo:persistent,annotation:mediated + +# byte +org.apache.jdo.pc.PCArrays#_byteArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyByteArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullByteArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_ByteArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_ByteArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_ByteArray=jdo:persistent,annotation:mediated + +# short +org.apache.jdo.pc.PCArrays#_shortArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyShortArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullShortArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_ShortArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_ShortArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_ShortArray=jdo:persistent,annotation:mediated + +# int +org.apache.jdo.pc.PCArrays#_intArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyIntArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullIntArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_IntegerArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_IntegerArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_IntegerArray=jdo:persistent,annotation:mediated + +# long +org.apache.jdo.pc.PCArrays#_longArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyLongArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullLongArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_LongArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_LongArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_LongArray=jdo:persistent,annotation:mediated + +# float +org.apache.jdo.pc.PCArrays#_floatArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyFloatArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullFloatArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_FloatArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_FloatArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_FloatArray=jdo:persistent,annotation:mediated + +# double +org.apache.jdo.pc.PCArrays#_doubleArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyDoubleArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullDoubleArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#_lang_DoubleArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_empty_lang_DoubleArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_null_lang_DoubleArray=jdo:persistent,annotation:mediated + +# String +org.apache.jdo.pc.PCArrays#_stringArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyStringArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullStringArray=jdo:persistent,annotation:mediated + +# Date +org.apache.jdo.pc.PCArrays#_dateArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyDateArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullDateArray=jdo:persistent,annotation:mediated + +# BigDecimal +org.apache.jdo.pc.PCArrays#_bigDecimalArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyBigDecimalArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullBigDecimalArray=jdo:persistent,annotation:mediated + +# BigInteger +org.apache.jdo.pc.PCArrays#_bigIntegerArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyBigIntegerArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullBigIntegerArray=jdo:persistent,annotation:mediated + +# Locale +org.apache.jdo.pc.PCArrays#_localeArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyLocaleArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullLocaleArray=jdo:persistent,annotation:mediated + +# ArrayList +org.apache.jdo.pc.PCArrays#_arrayListArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyArrayListArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullArrayListArray=jdo:persistent,annotation:mediated + +# HashMap +org.apache.jdo.pc.PCArrays#_hashMapArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyHashMapArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullHashMapArray=jdo:persistent,annotation:mediated + +# HashSet +org.apache.jdo.pc.PCArrays#_hashSetArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyHashSetArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullHashSetArray=jdo:persistent,annotation:mediated + +# Hashtable +org.apache.jdo.pc.PCArrays#_hashtableArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyHashtableArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullHashtableArray=jdo:persistent,annotation:mediated + +# LinkedList +org.apache.jdo.pc.PCArrays#_linkedListArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyLinkedListArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullLinkedListArray=jdo:persistent,annotation:mediated + +# TreeMap +org.apache.jdo.pc.PCArrays#_treeMapArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyTreeMapArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullTreeMapArray=jdo:persistent,annotation:mediated + +# TreeSet +org.apache.jdo.pc.PCArrays#_treeSetArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyTreeSetArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullTreeSetArray=jdo:persistent,annotation:mediated + +# Vector +org.apache.jdo.pc.PCArrays#_vectorArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_emptyVectorArray=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCArrays#_nullVectorArray=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCArrays#date=jdo:persistent,annotation:mediated +# +# End of PCArrays + + +# PCStroke +org.apache.jdo.pc.PCStroke=jdo:persistent +org.apache.jdo.pc.PCStroke#points=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCLargeObj=jdo:persistent +org.apache.jdo.pc.PCLargeObj#x=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCRect=jdo:persistent +org.apache.jdo.pc.PCRect#lowerRight=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCRect#upperLeft=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCRefArrays=jdo:persistent +org.apache.jdo.pc.PCRefArrays#_pcpointArray=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCInterfaces=jdo:persistent +org.apache.jdo.pc.PCInterfaces#_list=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCInterfaces#_emptyList=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCInterfaces#_nullList=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCCycle=jdo:persistent +org.apache.jdo.pc.PCCycle#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCycle#c2=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCCycle2=jdo:persistent +org.apache.jdo.pc.PCCycle2#id=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCycle2#c=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCSCO=jdo:persistent +org.apache.jdo.pc.PCSCO#_date=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullDate=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCSCO#_scoDate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullSCODate=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCSCO#_sqlDate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullSqlDate=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCSCO#_bigDecimal=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullBigDecimal=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCSCO#_bigInteger=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullBigInteger=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCSCO#_bitSet=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullBitSet=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCSCO#_locale=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCSCO#_nullLocale=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCDepartment=jdo:persistent +org.apache.jdo.pc.PCDepartment#deptid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCDepartment#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCDepartment#employees=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCEmployee=jdo:persistent +org.apache.jdo.pc.PCEmployee#empid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#lastname=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#firstname=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#hiredate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#birthdate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#salary=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#projects=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#department=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#manager=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#employees=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee#insurance=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCInsurance=jdo:persistent +org.apache.jdo.pc.PCInsurance#insid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCInsurance#carrier=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCInsurance#employee=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCProject=jdo:persistent +org.apache.jdo.pc.PCProject#projid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCProject#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCProject#employees=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCDepartment1=jdo:persistent +org.apache.jdo.pc.PCDepartment1#deptid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCDepartment1#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCDepartment1#employees=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCEmployee1=jdo:persistent +org.apache.jdo.pc.PCEmployee1#empid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#lastname=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#firstname=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#hiredate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#birthdate=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#salary=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#projects=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#department=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#manager=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#employees=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCEmployee1#insurance=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCFullTimeEmployee1=jdo:persistent,super:org.apache.jdo.pc.PCEmployee1 +org.apache.jdo.pc.PCFullTimeEmployee1#range=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCInsurance1=jdo:persistent +org.apache.jdo.pc.PCInsurance1#insid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCInsurance1#carrier=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCInsurance1#employee=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCProject1=jdo:persistent +org.apache.jdo.pc.PCProject1#projid=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCProject1#name=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCProject1#employees=jdo:persistent,annotation:mediated + + +org.apache.jdo.pc.PCBase=jdo:persistent +org.apache.jdo.pc.PCBase#s=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCDerived=jdo:persistent,super:org.apache.jdo.pc.PCBase + +# +# PCId, PCCollection are Introduced +# for regression testing bugid 4833532 +# +org.apache.jdo.pc.PCId=jdo:persistent +org.apache.jdo.pc.PCId#id=jdo:persistent,annotation:mediated + +org.apache.jdo.pc.PCCollection=jdo:persistent +org.apache.jdo.pc.PCCollection#id=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollection#set=jdo:persistent,annotation:mediated +org.apache.jdo.pc.PCCollection#map=jdo:persistent,annotation:mediated Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass1.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass1.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass1.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass1.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,83 @@ +/* + * 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.pc.serializable; + +import java.io.Serializable; + +/** + * A pc class has no persistence-capable superclass, implements + * java.io.Serializable, but does not provide an implementation of methods + * writeObject or writeReplace. + * + * The enhancer should add the following methods to the pc class: + * protected final void jdoPreSerialize() { + * final javax.jdo.spi.StateManager sm = this.jdoStateManager; + * if (sm != null) { sm.preSerialize(this); } + * } + * private void writeObject(java.io.ObjectOutputStream out) + * throws java.io.IOException { + * jdoPreSerialize(); + * out.defaultWriteObject(); + * } + * + * @author Michael Bouschen + */ +public class PCClass1 + implements Serializable +{ + private int s01; + private transient int t02; + + public PCClass1() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE); + } + public PCClass1(int s01, int t02) + { + this.s01 = s01; + this.t02 = t02; + } + + public int getS01() { return s01; } + public void setS01(int value) { this.s01 = value; } + + public int getT02() { return t02; } + public void setT02(int value) { this.t02 = value; } + + public boolean equals(Object obj) { + if (obj==null || !(obj instanceof PCClass1)) return false; + PCClass1 o = (PCClass1)obj; + if (this.s01 != o.s01) return false; + if (this.t02 != o.t02) return false; + return true; + } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCClass1(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + repr.append("s01="); repr.append(s01); + repr.append(", t02="); repr.append(t02); + } + +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2A.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2A.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2A.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2A.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,89 @@ +/* + * 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.pc.serializable; + +import java.io.Serializable; +import java.io.ObjectOutputStream; +import java.io.IOException; + +/** + * A pc class has no persistence-capable superclass, implements + * java.io.Serializable and provides an implementation of method + * writeObject. + * + * The enhancer should add a method jdoPreSerialize + * protected final void jdoPreSerialize() { + * final javax.jdo.spi.StateManager sm = this.jdoStateManager; + * if (sm != null) { sm.preSerialize(this); } + * } + * and should add a call of method jdoPreSerialize() to the existing + * method writeObject. It needs to be the first statement of writeObject. + * + * @author Michael Bouschen + */ +public class PCClass2A + implements Serializable +{ + private int s01; + private transient int t02; + + public PCClass2A() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE); + } + public PCClass2A(int s01, int t02) + { + this.s01 = s01; + this.t02 = t02; + } + + public int getS01() { return s01; } + public void setS01(int value) { this.s01 = value; } + + public int getT02() { return t02; } + public void setT02(int value) { this.t02 = value; } + + public boolean equals(Object obj) { + if (obj==null || !(obj instanceof PCClass2A)) return false; + PCClass2A o = (PCClass2A)obj; + if (this.s01 != o.s01) return false; + if (this.t02 != o.t02) return false; + return true; + } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCClass2A(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + repr.append("s01="); repr.append(s01); + repr.append(", t02="); repr.append(t02); + } + + // --- implement writeObject --- + + private void writeObject(ObjectOutputStream out) + throws IOException + { + out.defaultWriteObject(); + } +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2B.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2B.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2B.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCClass2B.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,87 @@ +/* + * 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.pc.serializable; + +import java.io.Serializable; +import java.io.ObjectStreamException; + +/** + * A pc class has no persistence-capable superclass, implements + * java.io.Serializable and provides an implementation of method + * writeReplace. + * + * The enhancer should add a method jdoPreSerialize + * protected final void jdoPreSerialize() { + * final javax.jdo.spi.StateManager sm = this.jdoStateManager; + * if (sm != null) { sm.preSerialize(this); } + * } + * and should add a call of method jdoPreSerialize() to the existing + * method writeReplace. It needs to be the first statement of writeReplace. + * + * @author Michael Bouschen + */ +public class PCClass2B + implements Serializable +{ + private int s01; + private transient int t02; + + public PCClass2B() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE); + } + public PCClass2B(int s01, int t02) + { + this.s01 = s01; + this.t02 = t02; + } + + public int getS01() { return s01; } + public void setS01(int value) { this.s01 = value; } + + public int getT02() { return t02; } + public void setT02(int value) { this.t02 = value; } + + public boolean equals(Object obj) { + if (obj==null || !(obj instanceof PCClass2B)) return false; + PCClass2B o = (PCClass2B)obj; + if (this.s01 != o.s01) return false; + if (this.t02 != o.t02) return false; + return true; + } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCClass2B(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + repr.append("s01="); repr.append(s01); + repr.append(", t02="); repr.append(t02); + } + // --- implement writeReplace --- + + private Object writeReplace() + throws ObjectStreamException + { + return this; + } +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub3.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub3.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub3.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub3.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,87 @@ +/* + * 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.pc.serializable; + +/** + * There is the following inheritance hierarchy: + * PCSuper <- Transient <- PCSub. + * PCSuper and PCSub are pc classes, Transient is a non-pc class. + * PCSuper does not implement java.io.Serializable, but Transient does. + * PCSub automatically implement java.io.Serializable, because its super + * class implements the interface. + * PCSub does not provide an implementation of method writeObject or + * writeReplace. + * + * The enhancer should add a method jdoPreSerialize to the PCSuper and + * should add a method writeObject to PCSub3: + * private void writeObject(java.io.ObjectOutputStream out) + * throws java.io.IOException { + * jdoPreSerialize(); + * out.defaultWriteObject(); + * } + * + * @author Michael Bouschen + */ +public class PCSub3 + extends Transient +{ + private String s03; + private transient String t04; + + public PCSub3() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE, "empty", "empty"); + } + public PCSub3(int s01, int t02, String s03, String t04) + { + super(s01, t02); + this.s03 = s03; + this.t04 = t04; + } + + public boolean equals(Object obj) { + if (obj==null || !(obj instanceof PCSub3)) return false; + PCSub3 o = (PCSub3)obj; + if (this.getS01() != o.getS01()) return false; + if (this.getT02() != o.getT02()) return false; + if (!stringEquals(this.s03, o.s03)) return false; + if (!stringEquals(this.t04, o.t04)) return false; + return true; + } + + private boolean stringEquals(String s1, String s2) + { + return (s1 == null) ? (s2 == null) : s1.equals(s2); + } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCSub3(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + super.addFieldRepr(repr); + repr.append(", s03="); repr.append(s03); + repr.append(", t04="); repr.append(t04); + } + + +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4A.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4A.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4A.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4A.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,92 @@ +/* + * 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.pc.serializable; + +import java.io.Serializable; +import java.io.ObjectOutputStream; +import java.io.IOException; + +/** + * There is the following inheritance hierarchy: + * PCSuper <- Transient <- PCSub. + * PCSuper and PCSub are pc classes, Transient is a non-pc class. + * PCSuper does not implement java.io.Serializable, but Transient does. + * PCSub automatically implement java.io.Serializable, because its super + * class implements the interface. + * PCSub provides an implementation of method writeObject. + * + * The enhancer should add a method jdoPreSerialize to the PCSuper and + * should add a call of method jdoPreSerialize() to the existing method + * writeObject. It needs to be the first statement of writeObject. + * + * @author Michael Bouschen + */ +public class PCSub4A + extends Transient +{ + private String s03; + private transient String t04; + + public PCSub4A() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE, "empty", "empty"); + } + public PCSub4A(int s01, int t02, String s03, String t04) + { + super(s01, t02); + this.s03 = s03; + this.t04 = t04; + } + + public boolean equals(Object obj) { + if (obj==null || !(obj instanceof PCSub4A)) return false; + PCSub4A o = (PCSub4A)obj; + if (this.getS01() != o.getS01()) return false; + if (this.getT02() != o.getT02()) return false; + if (!stringEquals(this.s03, o.s03)) return false; + if (!stringEquals(this.t04, o.t04)) return false; + return true; + } + + private boolean stringEquals(String s1, String s2) + { + return (s1 == null) ? (s2 == null) : s1.equals(s2); + } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCSub4A(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + super.addFieldRepr(repr); + repr.append(", s03="); repr.append(s03); + repr.append(", t04="); repr.append(t04); + } + + // --- implement writeObject --- + + private void writeObject(ObjectOutputStream out) + throws IOException + { + out.defaultWriteObject(); + } +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4B.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4B.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4B.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSub4B.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,91 @@ +/* + * 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.pc.serializable; + +import java.io.Serializable; +import java.io.ObjectStreamException; + +/** + * There is the following inheritance hierarchy: + * PCSuper <- Transient <- PCSub. + * PCSuper and PCSub are pc classes, Transient is a non-pc class. + * PCSuper does not implement java.io.Serializable, but Transient does. + * PCSub automatically implement java.io.Serializable, because its super + * class implements the interface. + * PCSub provides an implementation of method writeReplace. + * + * The enhancer should add a method jdoPreSerialize to the PCSuper and + * should add a call of method jdoPreSerialize() to the existing method + * writeObject. It needs to be the first statement of writeReplace. + * + * @author Michael Bouschen + */ +public class PCSub4B + extends Transient +{ + private String s03; + private transient String t04; + + public PCSub4B() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE, "empty", "empty"); + } + public PCSub4B(int s01, int t02, String s03, String t04) + { + super(s01, t02); + this.s03 = s03; + this.t04 = t04; + } + + public boolean equals(Object obj) { + if (obj==null || !(obj instanceof PCSub4B)) return false; + PCSub4B o = (PCSub4B)obj; + if (this.getS01() != o.getS01()) return false; + if (this.getT02() != o.getT02()) return false; + if (!stringEquals(this.s03, o.s03)) return false; + if (!stringEquals(this.t04, o.t04)) return false; + return true; + } + + private boolean stringEquals(String s1, String s2) + { + return (s1 == null) ? (s2 == null) : s1.equals(s2); + } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCSub4B(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + super.addFieldRepr(repr); + repr.append(", s03="); repr.append(s03); + repr.append(", t04="); repr.append(t04); + } + + // --- implement writeReplace --- + + private Object writeReplace() + throws ObjectStreamException + { + return this; + } +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSuper.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSuper.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSuper.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/PCSuper.java Fri Mar 18 17:02:29 2005 @@ -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. + */ + +package org.apache.jdo.pc.serializable; + +/** + * A persistence capable class that does not implement + * java.io.Serializable, used as superclass for other pc classes: PCSub3, + * PCSub4A, PCSub4B. + * + * The enhancer should add a method jdoPreSerialize: + * protected final void jdoPreSerialize() { + * final javax.jdo.spi.StateManager sm = this.jdoStateManager; + * if (sm != null) { sm.preSerialize(this); } + * } + * + * @author Michael Bouschen + */ +public class PCSuper +{ + private int s01; + private transient int t02; + + public PCSuper() + { + this(Integer.MIN_VALUE, Integer.MIN_VALUE); + } + public PCSuper(int s01, int t02) + { + this.s01 = s01; + this.t02 = t02; + } + + public int getS01() { return s01; } + public void setS01(int value) { this.s01 = value; } + + public int getT02() { return t02; } + public void setT02(int value) { this.t02 = value; } + + public String toString() + { + StringBuffer repr = new StringBuffer(); + addFieldRepr(repr); + return "PCSuper(" + repr.toString() + ")"; + } + + protected void addFieldRepr(StringBuffer repr) + { + repr.append("s01="); repr.append(s01); + repr.append(", t02="); repr.append(t02); + } +} + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Readme.txt URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Readme.txt?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Readme.txt (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Readme.txt Fri Mar 18 17:02:29 2005 @@ -0,0 +1,57 @@ +Test scenarios with serializable. + +(1) A pc class has no persistence-capable superclass, implements +java.io.Serializable, but does not provide an implementation of method +writeObject or writeReplace. + +The enhancer should add the following methods to the pc class: +- protected final void jdoPreSerialize() { + final javax.jdo.spi.StateManager sm = this.jdoStateManager; + if (sm != null) { sm.preSerialize(this); } + } +- private void writeObject(java.io.ObjectOutputStream out) + throws java.io.IOException { + jdoPreSerialize(); + out.defaultWriteObject(); + } + +(2A) A pc class has no persistence-capable superclass, implements +java.io.Serializable and provides an implementation of method writeObject. + +The enhancer should add a method jdoPreSerialize (code see above) and +should add a call of method jdoPreSerialize() to the existing +method writeObject. It needs to be the first statement of writeObject. + +(2B) A pc class has no persistence-capable superclass, implements +java.io.Serializable and provides an implementation of method writeReplace. + +The enhancer should add a method jdoPreSerialize (code see above) and +should add a call of method jdoPreSerialize() to the existing +method writeReplace. It needs to be the first statement of writeReplace. + +(3) There is the following inheritance hierarchy: +PCSuper <- Transient <- PCSub +- PCSuper and PCSub are pc classes, Transient is a non-pc class. +- PCSuper does not implement java.io.Serializable, but Transient does. + PCSub automatically implement java.io.Serializable, because its super + class implements the interface. +- PCSub does not provide an implementation of method writeObject. + +The enhancer should add a method jdoPreSerialize (code see above) to +PCSuper and should add a method writeObject (code see above) to PCSub. + +(4A) The same inheritance hierarchy as in (3) the only difference is that +PCSub provides an implementation of method writeObject. + +The enhancer should add a method jdoPreSerialize (code see above) to +PCSuper and should add a call of method jdoPreSerialize() to the +existing method writeObject. It needs to be the first statement of +writeObject. + +(4B) The same inheritance hierarchy as in (3) the only difference is that +PCSub provides an implementation of method writeReplace. + +The enhancer should add a method jdoPreSerialize (code see above) and +should add a call of method jdoPreSerialize() to the existing +method writeReplace. It needs to be the first statement of writeReplace. + Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Transient.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Transient.java?view=auto&rev=158176 ============================================================================== --- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Transient.java (added) +++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/serializable/Transient.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,33 @@ +/* + * 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.pc.serializable; + +/** + * Transient class in the following inheritance hierarchy: + * PCSuper <- Transient <- PCSub. It implements java.io.Serializable. + * + * @author Michael Bouschen + */ +public class Transient + extends PCSuper + implements java.io.Serializable +{ + public Transient() { super(); } + public Transient(int s01, int t02) { super(s01, t02); } + +} +