db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r583040 - in /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA: JPAAppPerson.java JPAAppPhoneNumber.java
Date Tue, 09 Oct 2007 03:57:26 GMT
Author: mcaisse
Date: Mon Oct  8 20:57:25 2007
New Revision: 583040

URL: http://svn.apache.org/viewvc?rev=583040&view=rev
Log:
JDO-543 Changed mapping of phone number

Modified:
    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/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=583040&r1=583039&r2=583040&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
Mon Oct  8 20:57:25 2007
@@ -74,13 +74,9 @@
         })
     private JPAAppAddress address;
 
-    // maps phone number types ("home", "work", "mobile", etc.) 
-    // to phone numbers specified as String
-//    @OneToMany(mappedBy="JPAAppPhoneNumber")
     @OneToMany
-    @MapKey(name="type")
-    private Map<String, JPAAppPhoneNumber> phoneNumbers = new HashMap();
-    
+    private Map<JPAAppPhoneNumber.Oid,
+            JPAAppPhoneNumber> phoneNumbers = new HashMap();    
     protected static SimpleDateFormat formatter =
         new SimpleDateFormat("d/MMM/yyyy");
 
@@ -254,8 +250,8 @@
         if (pnum != null) {
             pnumAsString = pnum.getPhoneNumber(); // old val
         }
-        pnum = phoneNumbers.put(type,
-                new JPAAppPhoneNumber(this, type, phoneNumber));
+        pnum = phoneNumbers.put(new JPAAppPhoneNumber.Oid(personid, type),
+                new JPAAppPhoneNumber(personid, type, phoneNumber));
         return pnumAsString;
     }
 
@@ -290,7 +286,7 @@
             String key = (String)entry.getKey();
             String value = (String)entry.getValue();
             JPAAppPhoneNumber newValue = 
-                    new JPAAppPhoneNumber(this, key, value);
+                    new JPAAppPhoneNumber(personid, key, value);
             retval.put(key, newValue);
         }
         return retval;

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=583040&r1=583039&r2=583040&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
Mon Oct  8 20:57:25 2007
@@ -41,9 +41,6 @@
     private String  type;
     @Column(name="PHONENO")
     private String  phoneNumber;
-    @ManyToOne
-    @JoinColumn(name="PERSONID", insertable=false, updatable=false)
-    private JPAAppPerson person;
     
     /** This is the JDO-required no-args constructor. */
     protected JPAAppPhoneNumber() {}
@@ -56,9 +53,8 @@
      * @param type The type of the phone for this number
      * @param phoneNumber The phone number
      */
-    public JPAAppPhoneNumber(JPAAppPerson person, String type, String phoneNumber) {
-        this.personid = person.getPersonid();
-        this.person = person;
+    public JPAAppPhoneNumber(long personid, String type, String phoneNumber) {
+        this.personid = personid;
         this.type = type;
         this.phoneNumber = phoneNumber;
     }



Mime
View raw message