ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morone, Bill" <Morone.B...@pennmutual.com>
Subject RE: lists as parameterClass
Date Fri, 21 Jul 2006 12:42:52 GMT
Actually, one key part of a lightweight SOA - 2T + 1 I call it. But that is blog material.
-----Original Message-----
From: Morone, Bill [mailto:Morone.Bill@pennmutual.com]
Sent: Friday, July 21, 2006 8:19 AM
To: user-java@ibatis.apache.org
Subject: RE: lists as parameterClass


Brandon,
 
Thanks for the quick reply. It works like a charm. I had one lexical error (oh, to be human)
and a few bogus column names.
 
I salute all the fine developers of iBatis SQLMaps. I am one of the select few "straight to
xml" guys (just a select statement) -- I rigged up a nice little method that translates the
result of  individual xml docs (each with an xml prolog) into one big doc. I later translate
that. A very lightweight SOA.
 
Thanks,
Bill Morone
 
 
 
 
-----Original Message-----
From: Brandon Goodin [mailto:brandon.goodin@gmail.com]
Sent: Friday, July 21, 2006 12:40 AM
To: user-java@ibatis.apache.org
Subject: Re: lists as parameterClass


I'm assuming the list is in your map parameter class.


<statement id="getPolicyList" parameterClass= "java.util.Map" resultClass="xml" xmlResultName="policy">


select acct.acct_id as policyid 

from acct, client_acct

where 

client_acct.client_id = #clientId#

and acct.acct_id = client_acct.acct_id

and client_acct.client_acct_role_cd in

<iterate open="(" close=")" conjunction="," property="clientRoles">

#clientRoles[]#

</iterate> 

</statement> 

Brandon


On 7/20/06, Morone, Bill < Morone.Bill@pennmutual.com  <mailto:Morone.Bill@pennmutual.com>
> wrote: 

How about this one? Please forgiv the "straight-to-xml"
 
<statement id="getPolicyList" parameterClass= "java.util.Map" resultClass="xml" xmlResultName="policy">


select acct.acct_id as policyid 

from acct, client_acct

where 

client_acct.client_id = #clientId#

and acct.acct_id = client_acct.acct_id

and client_acct.client_acct_role_cd in

<iterate open="(" close=")" conjunction=",">

#clientRoles[]#

</iterate> 

</statement> 


-----Original Message-----
From: Brandon Goodin [mailto: brandon.goodin@gmail.com]
Sent: Thursday, July 20, 2006 8:35 AM
To: user-java@ibatis.apache.org
Subject: Re: lists as parameterClass


Yes, this should work.

<select parameterClass="list">

select * from odm_product where id IN

    <iterate

      open=" ("
     close=")" conjunction=",">

      #[]#
    </iterate>
</select> 

Brandon Goodin



On 7/20/06, Thomas Karl Schwaerzler <  <mailto:Thomas.Schwaerzler@uibk.ac.at> Thomas.Schwaerzler@uibk.ac.at
> wrote: 


hello,

i'd like to do a query that looks like:

select * from odm_product where id IN (1,2); 


where i'd like to pass over a list of long values
as parameter ( java.lang.Long[] )

is there something like this posssible with ibatis?

greets
t.



This message, including any attachments, is intended only for the recipient(s) 
named above. It may contain confidential and privileged information. If you have 
received this communication in error, please notify the sender immediately and 


destroy or delete the original message. Also, please be aware that if you are not 
the intended recipient, any review, disclosure, copying, distribution or any 
action or reliance based on this message is prohibited by law.  





This message, including any attachments, is intended only for the recipient(s) 

named above. It may contain confidential and privileged information. If you have 

received this communication in error, please notify the sender immediately and 

destroy or delete the original message. Also, please be aware that if you are not 

the intended recipient, any review, disclosure, copying, distribution or any 

action or reliance based on this message is prohibited by law.  



This message, including any attachments, is intended only for the recipient(s) 
named above. It may contain confidential and privileged information. If you have 
received this communication in error, please notify the sender immediately and 
destroy or delete the original message. Also, please be aware that if you are not 
the intended recipient, any review, disclosure, copying, distribution or any 
action or reliance based on this message is prohibited by law.  

Mime
View raw message