Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 55269 invoked from network); 29 Jun 2006 06:09:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 06:09:06 -0000 Received: (qmail 10005 invoked by uid 500); 29 Jun 2006 06:08:56 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 9986 invoked by uid 500); 29 Jun 2006 06:08:55 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 9975 invoked by uid 99); 29 Jun 2006 06:08:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 23:08:55 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [216.193.202.245] (HELO waseda.lunarpages.com) (216.193.202.245) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 23:08:51 -0700 Received: from [12.46.199.130] (helo=RICK2) by waseda.lunarpages.com with esmtp (Exim 4.52) id 1FvpiA-0001gV-Mt for user-java@ibatis.apache.org; Wed, 28 Jun 2006 23:09:12 -0700 From: "Rick" To: Subject: RE: Working with composite objects and the syntax phoneNumbers[0].areaCode Date: Wed, 28 Jun 2006 23:08:23 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0042_01C69B07.C4D3D090" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-Index: AcabKhnGafa1YOIdSBCNN+gK6WFRewAF3QNg X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - waseda.lunarpages.com X-AntiAbuse: Original Domain - ibatis.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - arc-mind.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20060629060854.5E6A010FB00E@asf.osuosl.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0042_01C69B07.C4D3D090 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Thank you for answering my questions. I am new to iBatis and so far really dig it. Comments below.. I am willing to update the FAQ (WIKI) with my workaround. _____ From: Jeff Butler [mailto:jeffgbutler@gmail.com] Sent: Wednesday, June 28, 2006 8:13 PM To: user-java@ibatis.apache.org Subject: Re: Working with composite objects and the syntax phoneNumbers[0].areaCode This may be a bug in iBATIS. I'll take a closer look tomorrow. ** Somebody asked before and was told it is not a bug by Clinton see http://www.mail-archive.com/dev@ibatis.apache.org/msg00521.html. It's a little unusual to use this syntax in a result map - so maybe that's why it's not come up sooner (no excuses - it should work). ** It maybe unusual but according to the developer guide page 50 as of 6/16/2006 this should work. I think iBatis target market is mature database schemas (read legacy). A lot of mature schemas are highly un-normalized for speed. I was surprised that it did not work. *** I am not sure if it is a bug or a feature request. I think it needs to be fixed OR page 50 needs to be reworded a bit since it says this will work. :o) I have a work around so I am not stuck. It is common to use this type of syntax with the dynamic sql tags, I know for sure that it works in that circumstance. ** Good to know. I'll need to work with those as well. Jeff Butler On 6/28/06, Rick wrote: I have a workaround as follows: (Notice I added setPhoneNumber1. and getPhoneNumber1.. It works, but not as clean as the old version. I don't want the object model tied this close to the db structure. ) package qcom.cas.mysourcej.poc.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class Contact implements Serializable { private List phoneNumbers = new ArrayList(); private String name; private boolean primaryContact; private String relationship = "Spouse"; public Contact() { phoneNumbers.add(new Phone()); phoneNumbers.add(new Phone()); phoneNumbers.add(new Phone()); phoneNumbers.add(new Phone()); } public Contact(String name) { super(); this.name = name; } public Contact(String name, Phone phone) { super(); this.name = name; phoneNumbers.add(phone); } public Contact(String name, Phone phone, String relationship) { this(name, phone); this.relationship = relationship; } public boolean isPrimaryContact() { return primaryContact; } public void setPrimaryContact(boolean primaryContact) { this.primaryContact = primaryContact; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List getPhoneNumbers() { return phoneNumbers; } public void setPhoneNumbers(List phoneNumbers) { this.phoneNumbers = phoneNumbers; } public String getRelationship() { return relationship; } public void setRelationship(String relationship) { this.relationship = relationship; } public void setPhoneNumber1(Phone phone) { this.phoneNumbers.set(0, phone); } public void setPhoneNumber2(Phone phone) { this.phoneNumbers.set(1, phone); } public void setPhoneNumber3(Phone phone) { this.phoneNumbers.set(2, phone); } public void setPhoneNumber4(Phone phone) { this.phoneNumbers.set(3, phone); } public Phone getPhoneNumber1(){ return (Phone) this.phoneNumbers.get(0); } public Phone getPhoneNumber2(){ return (Phone) this.phoneNumbers.get(1); } public Phone getPhoneNumber3(){ return (Phone) this.phoneNumbers.get(2); } public Phone getPhoneNumber4(){ return (Phone) this.phoneNumbers.get(3); } } I am in no hurry for a solution, but I vote that you support the syntax you declare on page 50 of your user doc. (I don't really get a vote but if I did that is how I would vote). Rick Hightower _____ From: Rick [mailto: ricks_mailinglists@arc-mind.com] Sent: Wednesday, June 28, 2006 5:22 PM To: user-java@ibatis.apache.org Subject: Working with composite objects and the syntax phoneNumbers[0].areaCode I have a result set that has phone1, phone2, phone3, phone4, areaCode1, areaCode2, areaCode3, areaCode4. I want to map these to composite objects. I.e., Employee has Contacts, Contact has phone numbers, phone number consist of number and area code. When I try to map this, I get this error: Caused by: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named 'phoneNumbers[0]' in class 'qcom.cas.mysourcej.poc.model.Contact ' at com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:174) at com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForSetter(GenericPr obe.java:250) at com.ibatis.common.beans.GenericProbe.getPropertyTypeForSetter(GenericProbe.j ava:137) at com.ibatis.sqlmap.engine.builder.xml.BaseParser.resolveTypeHandler(BaseParse r.java:68) at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$15.process(SqlMapParser.ja va:403) . Here is my mapping file: Page 50 of the iBatis user manual states that the syntax phoneNumbers[3].areaCode is possible for a mapping. I googled this as follows: http://www.google.com/search?hl=en &lr=lang_en&newwindow=1&rls=GGLG%2CGGLG%3A2006-17%2CGGLG%3Aen&q=%22There+is+ no+WRITEABLE+property+named%22+ProbeException I did notice that there was a similar issue at: http://www.mail-archive.com/dev@ibatis.apache.org/msg00521.html It seems this syntax may not be supported even though the documents elude that it is on page 50. How do you do this w/o the above syntax? Here is the object model for reference.. package qcom.cas.mysourcej.poc.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class Contact implements Serializable { private List phoneNumbers = new ArrayList(); private String name; private boolean primaryContact; private String relationship = "Spouse"; public Contact() { phoneNumbers.add(new Phone()); phoneNumbers.add(new Phone()); phoneNumbers.add(new Phone()); phoneNumbers.add(new Phone()); } public Contact(String name) { super(); this.name = name; } public Contact(String name, Phone phone) { super(); this.name = name; phoneNumbers.add(phone); } public Contact(String name, Phone phone, String relationship) { this(name, phone); this.relationship = relationship; } public boolean isPrimaryContact() { return primaryContact; } public void setPrimaryContact(boolean primaryContact) { this.primaryContact = primaryContact; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List getPhoneNumbers() { return phoneNumbers; } public void setPhoneNumbers(List phoneNumbers) { this.phoneNumbers = phoneNumbers; } public String getRelationship() { return relationship; } public void setRelationship(String relationship) { this.relationship = relationship; } } package qcom.cas.mysourcej.poc.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class Employee implements Serializable{ private String emplid; private List directReports = new ArrayList(); private List contacts = new ArrayList(); private Employee boss; private String name; public Employee () { } public Employee(Employee boss, String name) { super(); this.boss = boss; this.name = name; if (this.boss !=null) { boss.addEmployee(this); } } public Employee(Employee boss, String name, Contact contact) { this(boss, name); contacts.add(contact); } public void addEmployee(Employee employee) { employee.setBoss(this); this.directReports.add(employee); } public String getName() { return name; } public void setName(String name) { this.name = name; } public List getDirectReports() { return directReports; } public void setDirectReports(List directReports) { this.directReports = directReports; } public Employee getBoss() { return boss; } public void setBoss(Employee boss) { this.boss = boss; } public List getContacts() { return contacts; } public void setContacts(List contacts) { this.contacts = contacts; } public String toString() { return name; } public String getEmplid() { return emplid; } public void setEmplid(String emplid) { this.emplid = emplid; } } package qcom.cas.mysourcej.poc.model; import java.io.Serializable; public class Phone implements Serializable{ private String areaCode; private String number; private boolean uS=true; public Phone () { } public Phone(String areaCode, String number, boolean us) { super(); this.areaCode = areaCode; this.number = number; uS = us; } public String getAreaCode() { return areaCode; } public void setAreaCode(String areaCode) { this.areaCode = areaCode; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public boolean isUS() { return uS; } public void setUS(boolean us) { uS = us; } public String toString() { if (uS) { return this.areaCode + "\\" + this.number; } else { return this.areaCode + "-" + this.number; } } } ------=_NextPart_000_0042_01C69B07.C4D3D090 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thank you for answering my = questions. I am new to iBatis and so far really dig it.

 

Comments = below….

 

I am willing to update the FAQ = (WIKI) with my workaround.


From: Jeff = Butler [mailto:jeffgbutler@gmail.com]
Sent: Wednesday, June 28, = 2006 8:13 PM
To: = user-java@ibatis.apache.org
Subject: Re: Working with composite objects and the syntax = phoneNumbers[0].areaCode

 

This may be a bug in iBATIS.  I'll take a closer look tomorrow. 

 

** Somebody asked before and was = told it is not a bug by Clinton see http://www.mail-archive.com/dev@ibatis.apache.org/msg00521.html.

 

It's a little unusual to use this syntax in a result map - so = maybe that's why it's not come up sooner (no excuses - it should = work).

 

** It maybe unusual but according = to the developer guide page 50 as of 6/16/2006 this should work. I think iBatis = target market is mature database schemas (read = legacy).

A lot of mature schemas are highly = un-normalized for speed. I was surprised that it did not work. =

 

*** I am not sure if it is a bug or = a feature request. I think it needs to be fixed OR page 50 needs to be = reworded a bit since it says this will work. :o)

I have a work around so I am not = stuck.

 

It is common to use this type of syntax with the dynamic = sql tags, I know for sure that it works in that = circumstance.

 

=

** Good to know. I’ll need to = work with those as well.

 

 

Jeff Butler

 

On 6/28/06, Rick <ricks_mailinglists@arc-mi= nd.com> wrote:

I have a workaround as = follows:

 

(Notice I added setPhoneNumber1… and = getPhoneNumber1…. It works, but not as clean as the old version. I don't want the object = model tied this close to the db structure. )

 

package = qcom.cas.mysourcej.poc.model;

 

import = java.io.Serializable;

import = java.util.ArrayList;

import java.util.List;

 

public class Contact implements Serializable = {

         &= nbsp;  private List phoneNumbers =3D new = ArrayList();

 

 

         &= nbsp;  private String name;

         &= nbsp;  private boolean primaryContact;

         &= nbsp;  private String relationship =3D = "Spouse";

 

         &= nbsp;  public Contact() {

         &= nbsp;           &n= bsp;  phoneNumbers.add(new Phone());

         &= nbsp;           &n= bsp;  phoneNumbers.add(new Phone());

         &= nbsp;           &n= bsp;  phoneNumbers.add(new Phone());

         &= nbsp;           &n= bsp;  phoneNumbers.add(new Phone());

         &= nbsp;  }

 

 

 

         &= nbsp;  public Contact(String name) {

         &= nbsp;           &n= bsp;  super();

         &= nbsp;           &n= bsp;  this.name =3D = name;

         &= nbsp;  }

 

         &= nbsp;  public Contact(String name, Phone phone) {

         &= nbsp;           &n= bsp;  super();

         &= nbsp;           &n= bsp;  this.name =3D = name;

         &= nbsp;           &n= bsp;  phoneNumbers.add(phone);

         &= nbsp;  }

 

         &= nbsp;  public Contact(String name, Phone phone, String relationship) = {

         &= nbsp;           &n= bsp;  this(name, phone);

         &= nbsp;           &n= bsp;  this.relationship =3D relationship;

         &= nbsp;  }

 

         &= nbsp;  public boolean isPrimaryContact() {

         &= nbsp;           &n= bsp;  return primaryContact;

         &= nbsp;  }

         &= nbsp;  public void setPrimaryContact(boolean primaryContact) = {

         &= nbsp;           &n= bsp;  this.primaryContact =3D primaryContact;

         &= nbsp;  }

         &= nbsp;  public String getName() {

         &= nbsp;           &n= bsp;  return name;

         &= nbsp;  }

         &= nbsp;  public void setName(String name) {

         &= nbsp;           &n= bsp;  this.name =3D = name;

         &= nbsp;  }

         &= nbsp;  public List getPhoneNumbers() {

         &= nbsp;           &n= bsp;  return phoneNumbers;

         &= nbsp;  }

         &= nbsp;  public void setPhoneNumbers(List phoneNumbers) = {

         &= nbsp;           &n= bsp;  this.phoneNumbers =3D phoneNumbers;

         &= nbsp;  }

 

         &= nbsp;  public String getRelationship() {

         &= nbsp;           &n= bsp;  return relationship;

         &= nbsp;  }

 

         &= nbsp;  public void setRelationship(String relationship) = {

         &= nbsp;           &n= bsp;  this.relationship =3D relationship;

         &= nbsp;  }

 

         &= nbsp;  public void setPhoneNumber1(Phone phone) {

         &= nbsp;           &n= bsp;  this.phoneNumbers.set(0, phone);

         &= nbsp;  }

         &= nbsp;  public void setPhoneNumber2(Phone phone) {

         &= nbsp;           &n= bsp;  this.phoneNumbers.set(1, phone);

         &= nbsp;  }

         &= nbsp;  public void setPhoneNumber3(Phone phone) {

         &= nbsp;           &n= bsp;  this.phoneNumbers.set(2, phone);

         &= nbsp;  }

         &= nbsp;  public void setPhoneNumber4(Phone phone) {

         &= nbsp;           &n= bsp;  this.phoneNumbers.set(3, phone);

         &= nbsp;  }

 

         &= nbsp;  public Phone getPhoneNumber1(){

         &= nbsp;           &n= bsp;  return (Phone) this.phoneNumbers.get(0);

         &= nbsp;  }

         &= nbsp;  public Phone getPhoneNumber2(){

         &= nbsp;           &n= bsp;  return (Phone) this.phoneNumbers.get(1);

         &= nbsp;  }

         &= nbsp;  public Phone getPhoneNumber3(){

         &= nbsp;           &n= bsp;  return (Phone) this.phoneNumbers.get(2);

         &= nbsp;  }

         &= nbsp;  public Phone getPhoneNumber4(){

         &= nbsp;           &n= bsp;  return (Phone) this.phoneNumbers.get(3);

         &= nbsp;  }

 

}

 

 

I am in no hurry for a solution, but I vote that you = support the syntax you declare on page 50 of your user doc. (I don't really get = a vote but if I did that is how I would vote).

 

Rick Hightower

 


From: Rick [mailto: ricks_mailinglists@arc-mind.com]
Sent: Wednesday, June 28, = 2006 5:22 PM
To: user-java@ibatis.apache.org
Subject: Working with = composite objects and the syntax = phoneNumbers[0].areaCode

 

 

I have a result set that has phone1, phone2, phone3, phone4, areaCode1, areaCode2, areaCode3, areaCode4.

 

I want to map these to composite objects.

 

I.e., Employee has Contacts, Contact has phone numbers, phone number consist = of number and area code.

 

When I try to map this, I get this error:

 

 

Caused by:

com.ibatis.common.beans.Prob= eException: There is no WRITEABLE property named 'phoneNumbers[0]' in class 'qcom.cas.mysourcej.poc.model.Contact '

    &nbs= p;       at = com.ibatis.common.beans.ClassInfo.getSetterType(ClassInfo.java:174)

    &nbs= p;       at = com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForSetter(Generi= cProbe.java:250)

    &nbs= p;       at com.ibatis.common.beans.GenericProbe.getPropertyTypeForSetter(GenericProb= e.java:137)

    &nbs= p;       at = com.ibatis.sqlmap.engine.builder.xml.BaseParser.resolveTypeHandler(BasePa= rser.java:68)

    &nbs= p;       at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$15.process(SqlMapParser= .java:403)

    &nbs= p;       …

 

Here is my mapping file:

 

      <resultMap = id=3D "employee" = class =3D"qcom.cas.mysourcej.poc.model.E= mployee" groupBy=3D "emplid"> =

      &n= bsp;     <result = property=3D "emplid" = column =3D"emplid" = />

      &n= bsp;     <result = property=3D "name" = column =3D"name" = />

      &n= bsp;     <result = property=3D "contacts" = resultMap =3D"employee.contacts" />

      </resultMap = >

 

      <resultMap = id=3D "contacts" = class =3D"qcom.cas.mysourcej.poc.model.C= ontact" >

      &n= bsp;     <result = property=3D "name" = column =3D"contact_name" = />

      &n= bsp;     <result = property=3D = "primaryContact" column =3D"primary_contact"

      =               typeHandler=3D = "qcom.cas.commons.ibatis.typehandler.StringBooleanTypeHandler" />

      &n= bsp;     <result = property=3D "relationship" = column =3D"relation" />

      &n= bsp;     <result = property=3D "phoneNumbers[0].number" column =3D"phone1" />

      &n= bsp;     <result = property=3D = "phoneNumbers[1].number" column =3D"phone2" />

      &n= bsp;     <result = property=3D "phoneNumbers[2].number" column =3D"phone3" />

      &n= bsp;     <result = property=3D "phoneNumbers[3].number" column =3D"phone4" />

      &n= bsp;     <result = property=3D "phoneNumbers[0].areaCode" column =3D"areaCode1"<= font size=3D2 color=3D"#2a00ff" face=3D"Courier New"> />

      &n= bsp;     <result = property=3D "phoneNumbers[1].areaCode" column =3D"areaCode2"<= font size=3D2 color=3D"#2a00ff" face=3D"Courier New"> />

      &n= bsp;     <result = property=3D "phoneNumbers[2].areaCode" column =3D"areaCode3"<= font size=3D2 color=3D"#2a00ff" face=3D"Courier New"> />

      &n= bsp;     <result = property=3D "phoneNumbers[3].areaCode" column =3D"areaCode4"<= font size=3D2 color=3D"#2a00ff" face=3D"Courier New"> />

      </resultMap = >

 

Page 50 of the iBatis user manual states that the syntax phoneNumbers[3].areaCode  is possible for a mapping.

 

I googled this as follows: http://www.google.com/search?hl=3Den&lr=3Dlang_en&a= mp;newwindow=3D1&rls=3DGGLG%2CGGLG%3A2006-17%2CGGLG%3Aen&q=3D%22T= here+is+no+WRITEABLE+property+named%22+ProbeException

 

I did notice that there was a similar issue at: http://www.mail-archive.com/dev@ibatis.apache.org/msg00= 521.html

 

It seems this syntax may not be supported even though the documents elude = that it is on page 50. How do you do this w/o the above syntax? =

 

Here is the object model for reference….

 

package = qcom.cas.mysourcej.poc.model;

 

import java.io.Serializable;

import java.util.ArrayList;

import java.util.List;

 

public class Contact implements Serializable = {

      private List phoneNumbers = =3D new ArrayList();

 

 

      private String = name;

      private boolean = primaryContact;

      private String = relationship =3D "Spouse";

 

      public Contact() = {

            phoneNumbers.add(new Phone());

            phoneNumbers.add(new Phone());

            phoneNumbers.add(new Phone());

            phoneNumbers.add(new Phone());

      = }

 

 

 

      public Contact(String = name) {

            super();

            this.name =3D = name;

      = }

 

      public Contact(String = name, Phone phone) {

            super();

            this.name =3D = name;

            phoneNumbers.add(phone);

      = }

 

      public Contact(String = name, Phone phone, String relationship) {

            this(name, phone);

            this.relationship =3D relationship;

      = }

 

      public boolean = isPrimaryContact() {

            return primaryContact;

      = }

      public void setPrimaryContact(boolean primaryContact) {

            this.primaryContact =3D primaryContact;

      = }

      public String getName() = {

            return name;

      = }

      public void setName(String = name) {

            this.name =3D = name;

      = }

      public List = getPhoneNumbers() {

            return phoneNumbers;

      = }

      public void = setPhoneNumbers(List phoneNumbers) {

            this.phoneNumbers =3D phoneNumbers;

      = }

 

 

 

      public String = getRelationship() {

            return relationship;

      = }

 

 

 

      public void setRelationship(String relationship) {

            this.relationship =3D relationship;

      = }

}

 

package = qcom.cas.mysourcej.poc.model;

 

import java.io.Serializable;

import java.util.ArrayList;

import java.util.List;

 

public class Employee implements = Serializable{

      private String = emplid;

      private List directReports = =3D new ArrayList();

      private List contacts =3D = new ArrayList();

      private Employee = boss;

      private String = name;

 

      public Employee () = {

 

      = }

 

      public Employee(Employee = boss, String name) {

            super();

            this.boss =3D boss;

            this.name =3D = name;

            if (this.boss !=3Dnull) {

           &= nbsp;      boss.addEmployee(this);

            }

      = }

 

      public Employee(Employee = boss, String name, Contact contact) {

            this(boss, name);

            contacts.add(contact);

      = }

 

      public void = addEmployee(Employee employee) {

            employee.setBoss(this);

            this.directReports.add(employee);

      = }

      public String getName() = {

            return name;

      = }

      public void setName(String = name) {

            this.name =3D = name;

      = }

      public List = getDirectReports() {

            return directReports;

      = }

      public void = setDirectReports(List directReports) {

            this.directReports =3D directReports;

      = }

      public Employee getBoss() = {

            return boss;

      = }

      public void = setBoss(Employee boss) {

            this.boss =3D boss;

      = }

      public List getContacts() = {

            return contacts;

      = }

      public void = setContacts(List contacts) {

            this.contacts =3D contacts;

      = }

 

      public String toString() = {

            return name;

      = }

 

      public String getEmplid() = {

            return emplid;

      = }

 

      public void = setEmplid(String emplid) {

            this.emplid =3D emplid;

      = }

}

 

package = qcom.cas.mysourcej.poc.model;

 

import java.io.Serializable;

 

public class Phone implements = Serializable{

      private String = areaCode;

      private String = number;

      private boolean = uS=3Dtrue;

 

      public Phone () = {

 

      = }

 

      public Phone(String = areaCode, String number, boolean us) {

            super();

            this.areaCode =3D areaCode;

            this.number =3D number;

            uS =3D us;

      = }

 

      public String = getAreaCode() {

            return areaCode;

      = }

      public void = setAreaCode(String areaCode) {

            this.areaCode =3D areaCode;

      = }

      public String getNumber() = {

            return number;

      = }

      public void = setNumber(String number) {

            this.number =3D number;

      = }

      public boolean isUS() = {

            return uS;

      = }

      public void setUS(boolean = us) {

            uS =3D us;

      = }

 

      public String toString() = {

            if (uS) {

           &= nbsp;      return this.areaCode + "\\"  + = this.number;

            } else {

           &= nbsp;      return this.areaCode + "-"  + = this.number;

            }

      = }

}

 

 

 

 

------=_NextPart_000_0042_01C69B07.C4D3D090--