Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 20756 invoked from network); 15 Sep 2006 19:23:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2006 19:23:32 -0000 Received: (qmail 91177 invoked by uid 500); 15 Sep 2006 19:23:29 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 91162 invoked by uid 500); 15 Sep 2006 19:23:29 -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 91151 invoked by uid 99); 15 Sep 2006 19:23:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 12:23:29 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.132.125.81] (HELO mercury.fcci-group.com) (64.132.125.81) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 12:23:21 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6D8FC.319F1ADE" Subject: RE: Remap resultMap Date: Fri, 15 Sep 2006 15:21:50 -0400 Message-ID: <4460F957F3AB544B8E3DA489603578599926BC@mercury.fcci-group.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Remap resultMap Thread-Index: AcbXUkhD/PZWtGxlTX6ubQfhj2InBwBm9a+QAAAxOzAAAL3G8AABew/gAADfj5A= From: "Angel Braasch" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C6D8FC.319F1ADE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks again. =20 I got a WRITEABLE property named in the class with blanking out the policyDetail property. =20 To answer your previous questions... =20 I have the subqueires data in the policyDetailResults resultMap. I want to update/replace the policySrcResult resultMap's fields with the fields from policyDetailResults. i.e., policySrcResult.busEntity=3DpolicyDetailResults.busEntity. =20 I want to do this so that I have one object in the end. With the way it is now, in my java model, I have to do policy.setBusEntity(policy.getPolicyDetail().getBusEntity()) rather than it already being set. =20 Thanks Angel ________________________________ From: Poitras Christian [mailto:Christian.Poitras@ircm.qc.ca]=20 Sent: Friday, September 15, 2006 2:55 PM To: user-java@ibatis.apache.org Subject: RE: Remap resultMap Maybe the empty property attribute works in iBATIS resultMaps. I haven't tried it but it would result in your policySrcResult object properties busEntity and yrsInBus to be setted again (twice) with the same values has in policyDetail. =20 =20 =20 =20 =20 If this gives you the correct result, consider removing these lines from policySrcResult resultMap. =20 =20 Christian ________________________________ From: Angel Braasch [mailto:ABRAASCH@fcci-group.com]=20 Sent: Friday, 15 September 2006 14:15 To: user-java@ibatis.apache.org Subject: RE: Remap resultMap Thank you for the reply. =20 When I tried the below I got an error that BUSINESS_ENTITY is not a property of policyDetail. I changed it to busEntity, but I didn't get the results I was looking for. =20 Maybe I'm not explaining this well. I want to take the results of the below policyDetail property (which includes busEntity,yrsInBus) and re-assign them to policySrcResults' busEntity and yrsInBus properties. =20 =20 =20 =20 Thanks again for any assistance. =20 Angel ________________________________ From: Poitras Christian [mailto:Christian.Poitras@ircm.qc.ca]=20 Sent: Friday, September 15, 2006 1:50 PM To: user-java@ibatis.apache.org Subject: RE: Remap resultMap Try this. =20 =20 Christian ________________________________ From: Angel Braasch [mailto:ABRAASCH@fcci-group.com]=20 Sent: Friday, 15 September 2006 13:41 To: user-java@ibatis.apache.org Subject: RE: Remap resultMap I've been using IBATIS only for a short time....so I apologize if this a newbie question. Can anyone help me with this posting? =20 Angel=20 ________________________________ From: Angel Braasch [mailto:ABRAASCH@fcci-group.com]=20 Sent: Wednesday, September 13, 2006 12:33 PM To: user-java@ibatis.apache.org Subject: Remap resultMap I have a policy object that is getting mapped in a resultMap. In that resultMap I have to run another query to get additional properties. This is a 1:1 situation. I want to remap those additional properties(from policyDetailResults) back to the original resultMap(policySrcResult). =20 =20 I have tried to point "getPolicyDetail" to resultMap=3D"policySrcResult" remapResults=3D"true". But then I got an Invalid column name on my policyNumber field. =20 I'm at a loss on how to do this. Below are code snippets. =20 =20 Any assistance would be greatly appreciated. =20 Thanks, =20 Angel=20 =20 public class Policy{ private Policy policyDetail =3D null; private String busEntity; private String yrsInBus; private String policyNumber =3D null; private String polType =3D null; getters/setters..... } =20 =20 =20 =20 =20 ------_=_NextPart_001_01C6D8FC.319F1ADE Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Thanks again.
 
I got a WRITEABLE property named in the class = with blanking=20 out the policyDetail property.
 
To answer your previous = questions...
 
I have the subqueires data in the = policyDetailResults=20 resultMap.  I want to update/replace the policySrcResult resultMap's fields with the fields from=20 policyDetailResults.  i.e.,=20 policySrcResult.busEntity=3DpolicyDetailResults.busEntity.<= /SPAN>
 
I=20 want to do this so that I have one object in the end.  With the way = it is=20 now, in my java model, I have to do=20 policy.setBusEntity(policy.getPolicyDetail().getBusEntity()) rather than = it=20 already being set.
 
Thanks Angel

From: Poitras Christian=20 [mailto:Christian.Poitras@ircm.qc.ca]
Sent: Friday, September = 15,=20 2006 2:55 PM
To: = user-java@ibatis.apache.org
Subject: RE:=20 Remap resultMap

Maybe the empty property attribute works in = iBATIS=20 resultMaps. I haven't tried it but it would result in=20 your policySrcResult object properties busEntity and yrsInBus to be setted again = (twice) with the same=20 values has in policyDetail.
 
<resultMap = id=3D"policySrcResult"=20 class=3D"Policy">
    <result = column=3D"POLICY_NUMBER"=20 property=3D"policyNumber" jdbcType=3D"VARCHAR" = />
   =20 <result column=3D"POL_TYPE" property=3D"polType" jdbcType=3D"VARCHAR" = />
    <result column=3D"BUSINESS_ENTITY"=20 property=3D"busEntity" jdbcType=3D"VARCHAR" = /> 
   =20 <result column=3D"YRS_IN_BUS" property=3D"yrsInBus" = jdbcType=3D"VARCHAR"=20 />
 
   <result property=3D""=20 column=3D"{polType=3DPOL_TYPE,policyNumber=3DPOLICY_NUMBER}"=20 select=3D"getPolicyDetail"/>
   =20  
</resultMap>
<resultMap=20 id=3D"policyDetailResults" class=3D"Policy"> 
  =  <result=20 column=3D"BUSINESS_ENTITY" property=3D"busEntity" jdbcType=3D"VARCHAR" = />
 =20  <result column=3D"YRS_IN_BUS" property=3D"yrsInBus" = jdbcType=3D"VARCHAR"=20 />
   <result column=3D"BUSINESS_ENTITY" = property=3D"policyDetail.
busEntity" = jdbcType=3D"VARCHAR"=20 />
   <result column=3D"YRS_IN_BUS" property=3D"policyDetail.
yrsInBus" jdbcType=3D"VARCHAR" = />
</resultMap>
 
If=20 this gives you the correct result, consider removing these lines from = policySrcResult resultMap.
    <result column=3D"BUSINESS_ENTITY" = property=3D"busEntity" jdbcType=3D"VARCHAR" = /> 
   =20 <result column=3D"YRS_IN_BUS" property=3D"yrsInBus" = jdbcType=3D"VARCHAR"=20 />

 
Christian
=

From: Angel Braasch=20 [mailto:ABRAASCH@fcci-group.com]
Sent: Friday, 15 September = 2006=20 14:15
To: user-java@ibatis.apache.org
Subject: RE: = Remap=20 resultMap

Thank you for the reply.
 
When I tried the below I got an error = that=20 BUSINESS_ENTITY is not a property of policyDetail.  I changed it to = busEntity, but I didn't get the results I was looking = for.
 
Maybe I'm not explaining this well.  I = want to=20 take the results of the below policyDetail property (which includes=20 busEntity,yrsInBus) and re-assign them to policySrcResults' busEntity = and=20 yrsInBus properties.
<resultMap=20 id=3D"policySrcResult" class=3D"Policy">
    = <result=20 column=3D"POLICY_NUMBER" property=3D"policyNumber" jdbcType=3D"VARCHAR"=20 />
    <result column=3D"POL_TYPE" = property=3D"polType"=20 jdbcType=3D"VARCHAR" />
    <result=20 column=3D"BUSINESS_ENTITY" property=3D"busEntity" jdbcType=3D"VARCHAR"=20 /> 
    <result column=3D"YRS_IN_BUS"=20 property=3D"yrsInBus" jdbcType=3D"VARCHAR" = />
    <result property=3D"policyDetail"=20 column=3D"{polType=3DPOL_TYPE,policyNumber=3DPOLICY_NUMBER}"=20 select=3D"getPolicyDetail"/>
   =20  
</resultMap>
 
 
Thanks = again for any=20 assistance.
 
Angel


From: Poitras Christian=20 [mailto:Christian.Poitras@ircm.qc.ca]
Sent: Friday, September = 15,=20 2006 1:50 PM
To: = user-java@ibatis.apache.org
Subject: RE:=20 Remap resultMap

Try this.

<resultMap id=3D"policySrcResult"=20 class=3D"Policy">
    <result = column=3D"POLICY_NUMBER"=20 property=3D"policyNumber" jdbcType=3D"VARCHAR" = />
   =20 <result column=3D"POL_TYPE" property=3D"polType" jdbcType=3D"VARCHAR" = />
    <result column=3D"BUSINESS_ENTITY"=20 property=3D"busEntity" jdbcType=3D"VARCHAR" = /> 
   =20 <result column=3D"YRS_IN_BUS" property=3D"yrsInBus" = jdbcType=3D"VARCHAR"=20 />
    <result=20 property=3D"policyDetail.BUSINESS_ENTITY"=20 column=3D"BUSINESS_ENTITY"/>  &nbs= p;  
   =20 <result property=3D"policyDetail.YRS_IN_BUS"=20 column=3D"YRS_IN_BUS"/>   &nb= sp; 
</resultMap>


Christian


From: Angel Braasch=20 [mailto:ABRAASCH@fcci-group.com]
Sent: Friday, 15 September = 2006=20 13:41
To: user-java@ibatis.apache.org
Subject: RE: = Remap=20 resultMap

I've = been using=20 IBATIS only for a short = time....so I=20 apologize if this a newbie question.  Can anyone help me with this=20 posting?
 
Angel=20


From: Angel Braasch=20 [mailto:ABRAASCH@fcci-group.com]
Sent: Wednesday, September = 13, 2006=20 12:33 PM
To: user-java@ibatis.apache.org
Subject: = Remap=20 resultMap

I have = a policy=20 object that is getting mapped in a resultMap.  In that = resultMap I=20 have to run another query to get additional properties.   This = is a=20 1:1 situation.  I want to remap those additional properties(from=20 policyDetailResults) back to the original = resultMap(policySrcResult). =20
 
I have = tried to=20 point "getPolicyDetail" to resultMap=3D"policySrcResult" remapResults=3D"true".  But=20 then I got an Invalid column name on my policyNumber=20 field.
 
I'm at = a loss on how=20 to do this.   Below are code snippets.  =
 
Any = assistance would=20 be greatly appreciated.
 
Thanks,
 
Angel 
 

public class=20 Policy{
private Policy policyDetail =3D null;
private String=20 busEntity;
private String yrsInBus;
private String policyNumber = =3D=20 null;
private String polType =3D null;

getters/setters.....

}

<resultMap=20 id=3D"policySrcResult" class=3D"Policy">
    = <result=20 column=3D"POLICY_NUMBER" property=3D"policyNumber" jdbcType=3D"VARCHAR"=20 />
    <result column=3D"POL_TYPE" = property=3D"polType"=20 jdbcType=3D"VARCHAR" />
    <result=20 column=3D"BUSINESS_ENTITY" property=3D"busEntity" jdbcType=3D"VARCHAR"=20 /> 
    <result column=3D"YRS_IN_BUS"=20 property=3D"yrsInBus" jdbcType=3D"VARCHAR" = />
   =20 <result property=3D"policyDetail"=20 column=3D"{polType=3DPOL_TYPE,policyNumber=3DPOLICY_NUMBER}"=20 select=3D"getPolicyDetail"/>   =20  
</resultMap>

 

<resultMap=20 id=3D"policyDetailResults" class=3D"Policy"> 
  =  <result=20 column=3D"BUSINESS_ENTITY" property=3D"busEntity" jdbcType=3D"VARCHAR" = />
 =20  <result column=3D"YRS_IN_BUS" property=3D"yrsInBus" = jdbcType=3D"VARCHAR"=20 />
</resultMap>

 

<select=20 id=3D"getPolicyDetail" parameterClass=3D"Policy"=20 resultMap=3D"policyDetailResults">  
   = SELECT=20 BUSINESS_ENTITY, YRS_IN_BUS
   FROM
  =20 <dynamic>
     <isEqual = property=3D"polType"=20 compareValue=3D"N"> CPP_DETAIL </isEqual>
  =20   <isEqual property=3D"polType" compareValue=3D"U"> = UMB_DETAIL=20 </isEqual>
     <isEqual = property=3D"polType"=20 compareValue=3D"Q"> UMB_FARM_DETAIL </isEqual>
  =20   <isEqual property=3D"polType" compareValue=3D"X"> = CA_DETAIL=20 </isEqual>
     <isEqual = property=3D"polType"=20 compareValue=3D"B"> BOPS_DETAIL </isEqual>
  =20   <isEqual property=3D"polType" compareValue=3D"F"> = CPP_FARM_DETAIL=20 </isEqual>     
  =20 </dynamic>
   WHERE POLICY_NUMBER=3D#policyNumber#=20
</select>

------_=_NextPart_001_01C6D8FC.319F1ADE--