ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas <douglasf...@yahoo.com.br>
Subject Re: Parameter Map for nested class
Date Tue, 30 Nov 2004 17:27:31 GMT
Hi Lucy, try :

<parameterMap id="update-organization-param"
class="organization">
   <parameter property="contact.firstName" />
   <parameter property="contact.lastName" />
   <parameter property="orgId" />
</parameterMap>

<update id="updateOrganizationById"
parameterMap="update-organization-param">
   update organizations set orgcontactfname=?,        
         
          orgcontactlname=?
   where orgid=?
</update>

Douglas

 --- Lucy Fang <fang@acs.rutgers.edu> escreveu: 
> Hi,
> 
> I just started to use iBatis. I have a question
> about the parameter map with
> a nested class.
> 
> I have a organization class and contact class as
> following:
> 
> public class Organization {
> 	private int	orgId;
> 	private String	orgName;
> 	private Contact	contact;
> 
> Getter/setter method..
> }
> 
> public class contact {
> 	private String lastName;
> 	private String firstName;
> 	private String title;
> 	private String email;
> 	private String phone;
> 
> Getter/setter method..
> }
> 
> SQL Map to update organization:
> 
> 	<parameterMap id="update-organization-param"
> class="organization">
> 		<parameter property="contact.firstName" />
> 		<parameter property="contact.lastName" />
> 	</parameterMap>
> 	<update id="updateOrganizationById"
> parameterMap="update-organization-param">
> 		update organizations
> 			set orgcontactfname=?, orgcontactlname=?
> 		where orgid=#orgId#
> 	</update>
> 
> I tried to update organization using the sqlMap
> statement above, it didn't
> work.
> Any advices?
> 
> Thanks.
>  

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message