db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r586554 - in /db/jdo/trunk/tck2: ./ src/conf/ src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/
Date Fri, 19 Oct 2007 17:34:16 GMT
Author: mcaisse
Date: Fri Oct 19 10:34:15 2007
New Revision: 586554

URL: http://svn.apache.org/viewvc?rev=586554&view=rev
Log:
JDO-543

Added:
    db/jdo/trunk/tck2/src/conf/companyAnnotatedAllRelationshipsJPAPM.conf
    db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAConcrete.conf
      - copied, changed from r585230, db/jdo/trunk/tck2/src/conf/companyAnnotatedNoRelationshipsJPAConcrete.conf
    db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAPM.conf
Removed:
    db/jdo/trunk/tck2/src/conf/companyAnnotatedNoRelationshipsJPAConcrete.conf
Modified:
    db/jdo/trunk/tck2/project.properties
    db/jdo/trunk/tck2/src/conf/configurations.list
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java

Modified: db/jdo/trunk/tck2/project.properties
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/project.properties?rev=586554&r1=586553&r2=586554&view=diff
==============================================================================
--- db/jdo/trunk/tck2/project.properties (original)
+++ db/jdo/trunk/tck2/project.properties Fri Oct 19 10:34:15 2007
@@ -194,6 +194,7 @@
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPartTimeEmployee.java \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java \
+    org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppInsurance.java \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppMedicalInsurance.java \
@@ -420,6 +421,7 @@
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPartTimeEmployee.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.class \
+    org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppInsurance.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppMedicalInsurance.class \
@@ -708,6 +710,7 @@
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPartTimeEmployee.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.class \
+    org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppInsurance.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.class \
     org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppMedicalInsurance.class \

Added: db/jdo/trunk/tck2/src/conf/companyAnnotatedAllRelationshipsJPAPM.conf
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyAnnotatedAllRelationshipsJPAPM.conf?rev=586554&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/conf/companyAnnotatedAllRelationshipsJPAPM.conf (added)
+++ db/jdo/trunk/tck2/src/conf/companyAnnotatedAllRelationshipsJPAPM.conf Fri Oct 19 10:34:15
2007
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+jdo.tck.description = Completeness test with standard mapping, basic testdata with all relationships
\
+and embedded objects, annotations. 
+jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppPM
+jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
+jdo.tck.mapping = 0
+jdo.tck.requiredOptions =

Copied: db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAConcrete.conf (from r585230,
db/jdo/trunk/tck2/src/conf/companyAnnotatedNoRelationshipsJPAConcrete.conf)
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAConcrete.conf?p2=db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAConcrete.conf&p1=db/jdo/trunk/tck2/src/conf/companyAnnotatedNoRelationshipsJPAConcrete.conf&r1=585230&r2=586554&rev=586554&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/conf/companyAnnotatedNoRelationshipsJPAConcrete.conf (original)
+++ db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAConcrete.conf Fri Oct 19 10:34:15
2007
@@ -16,6 +16,6 @@
 jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships.

 jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppConcrete
 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
-jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml
 jdo.tck.mapping = 0
 jdo.tck.requiredOptions =

Added: db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAPM.conf
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAPM.conf?rev=586554&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAPM.conf (added)
+++ db/jdo/trunk/tck2/src/conf/companyAnnotatedEmbeddedJPAPM.conf Fri Oct 19 10:34:15 2007
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+jdo.tck.description = Completeness test with standard mapping, basic testdata with all relationships
\
+and embedded objects, annotations. 
+jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppPM
+jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml
+jdo.tck.mapping = 0
+jdo.tck.requiredOptions =

Modified: db/jdo/trunk/tck2/src/conf/configurations.list
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/configurations.list?rev=586554&r1=586553&r2=586554&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/conf/configurations.list (original)
+++ db/jdo/trunk/tck2/src/conf/configurations.list Fri Oct 19 10:34:15 2007
@@ -44,6 +44,7 @@
                  companyAnnotatedAllRelationshipsFCPM.conf \
                  companyAnnotatedAllRelationshipsPCConcrete.conf \
                  companyAnnotatedAllRelationshipsJPAConcrete.conf \
+                 companyAnnotatedAllRelationshipsJPAPM.conf \
                  companyAnnotatedAllRelationshipsPCPM.conf \
                  companyAnnotatedAllRelationshipsPIPM.conf \
                  companyAnnotatedEmbeddedFCPM.conf \
@@ -52,7 +53,8 @@
                  companyAnnotatedNoRelationshipsFCConcrete.conf \
                  companyAnnotatedNoRelationshipsFCPM.conf \
                  companyAnnotatedNoRelationshipsPCConcrete.conf \
-                 companyAnnotatedNoRelationshipsJPAConcrete.conf \
+                 companyAnnotatedEmbeddedJPAConcrete.conf \
+                 companyAnnotatedEmbeddedJPAPM.conf \
                  companyAnnotatedNoRelationshipsPCPM.conf \
                  companyAnnotatedNoRelationshipsPIPM.conf \
                  inheritance1.conf \

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java?rev=586554&r1=586553&r2=586554&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
(original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
Fri Oct 19 10:34:15 2007
@@ -75,7 +75,7 @@
         })
     private JPAAppAddress address;
 
-    @OneToMany(mappedBy="person")
+    @OneToMany(mappedBy="person", cascade=CascadeType.ALL)
     @MapKey(name="type")
     private Map<String, JPAAppPhoneNumber> phoneNumbers
             = new HashMap<String, JPAAppPhoneNumber>();    
@@ -224,7 +224,7 @@
      * @return A Map<String, String> of phone numbers.
      */
     public Map getPhoneNumbers() {
-        return (convertString2Phone(phoneNumbers));
+        return (convertPhone2String(phoneNumbers));
     }
 
     /**
@@ -278,10 +278,13 @@
      */
     public void setPhoneNumbers(Map phoneNumbers) {
         this.phoneNumbers = (phoneNumbers != null) ? 
-                convertPhone2String(phoneNumbers) : null;
+                convertString2Phone(phoneNumbers) : null;
     }
     
-    protected HashMap convertPhone2String(Map pnums) {
+    /**
+     * Converts HashMap<String, String> to HashMap<String, JPAAppPhoneNmber>
+     */
+    protected HashMap convertString2Phone(Map pnums) {
         HashMap retval = new HashMap();
         for (Object objEntry: pnums.entrySet()) {
             Map.Entry entry = (Map.Entry)objEntry;
@@ -289,12 +292,16 @@
             String value = (String)entry.getValue();
             JPAAppPhoneNumber newValue = 
                     new JPAAppPhoneNumber(this, key, value);
+//            System.out.println("Key = " + key + "  Value = " + value);
             retval.put(key, newValue);
         }
         return retval;
     }
     
-    protected HashMap convertString2Phone(Map pnums) {
+    /**
+     * Converts HashMap<String, JPAAppPhoneNmber> to HashMap<String, String>
+     */
+    protected HashMap convertPhone2String(Map pnums) {
         HashMap retval = new HashMap();
         for (Object objEntry: pnums.entrySet()) {
             Map.Entry entry = (Map.Entry)objEntry;
@@ -326,7 +333,7 @@
         rc.append(", ").append(lastname);
         rc.append(", ").append(firstname);
         rc.append(", born ").append(formatter.format(birthdate));
-        rc.append(", phone ").append(phoneNumbers);
+        rc.append(", phone ").append(convertPhone2String(phoneNumbers));
         return rc.toString();
     }
 
@@ -355,7 +362,7 @@
             helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename")
&
             helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate") &
             helper.deepEquals(address, otherPerson.getAddress(), where + ".address") &
-            helper.deepEquals(phoneNumbers, otherPerson.getPhoneNumbers(), where + ".phoneNumbers");
+            helper.deepEquals(convertPhone2String(phoneNumbers), otherPerson.getPhoneNumbers(),
where + ".phoneNumbers");
     }
 
     /** 

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java?rev=586554&r1=586553&r2=586554&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java
(original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java
Fri Oct 19 10:34:15 2007
@@ -127,7 +127,7 @@
      */
     protected String getFieldRepr() {
         StringBuffer rc = new StringBuffer();
-        rc.append(person);
+        rc.append(person.getPersonid());
         rc.append(", ").append(type);
         rc.append(", phone ").append(phoneNumber);
         return rc.toString();



Mime
View raw message