ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lisa Jenkins <lisa.jenk...@investoranalytics.com>
Subject Re: Inner select statements in resultMaps
Date Thu, 05 Jul 2007 15:34:33 GMT
Hi paul,

Why not just hard code it in the query ?

      *select ORD_ID, ORD_CST_ID*
      *from PAYMENT*
      *where/ PAY_ORD_ID/ = #itemId#*
      *and/ PAY_CST_TYPE/ = **/'BIG_SPENDER'/*




MCCORMICK, Paul wrote:
>
> Dear List,
> I'm using lazy loading for inner select statements in results maps. Is 
> it possible to hard code a parameter that’s passed to the inner select 
> statement. See below. I would like the string "BIG_SPENDER" to be 
> passed to the query* getOrderPayments*. Is this possible?
>
> *<resultMap id=”get-order-result” class=”com.ibatis.example.Order”>*
>
>       *<result property=”id” column=”ORD_ID”/>*
>       *<result property=”customerId” column=”ORD_CST_ID”/>*
>       *<result property=”payments” column=”/{itemId=ORD_ID,/
>       custType/='BIG_SPENDER'}/” select=”getOrderPayments”/>*
>
> *</resultMap>*
>
> *<select id=”getOrderPayments” resultMap=”get-payment-result”>*
>
>       *select ORD_ID, ORD_CST_ID*
>       *from PAYMENT*
>       *where/ PAY_ORD_ID/ = #itemId#*
>       *and/ PAY_CST_TYPE/ = #custType#*
>
> *</select>*
>
>
> Thanks,
> Paul
>
> "DISCLAIMER: This email, including any attachments, is intended only 
> for use by the addressee(s) and may contain confidential and/or 
> personal information and may also be the subject of legal privilege. 
> If you are not the intended recipient, you must not disclose or use 
> the information contained in it. In this case, please let me know by 
> return email, delete the message permanently from your system and 
> destroy any copies.
>
> Before you take any action based upon advice and/or information 
> contained in this email you should carefully consider the advice and 
> information and consider obtaining relevant independent advice.
>


Mime
View raw message