ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James, Steven" <Steven.Ja...@logicacmg.com>
Subject RE: Using WHERE IN along with AND
Date Fri, 15 Jul 2005 14:27:52 GMT
Can you not use 
<isParameterPresent prepend="AND"> 
    R.ORD_ID = O.ORD_ID    
 </isParameterPresent>


Steve...
-----Original Message-----orderIdList
From: Rao, Satish [mailto:satish.rao@fmr.com]
Sent: Thu 7/14/2005 4:23 PM
To: user-java@ibatis.apache.org
Subject: Using WHERE IN along with AND
 

I have the following <select> and it throws a UncategorizedSQL
exception...

	<select id="listDetailsForOrderIds"
parameterClass="java.util.List" resultMap="list-rundetail-result">
		SELECT 
			R.ORD_ID AS ORD_ID,
			PART_ID,
			CLNT_ID_N,
			PLAN_N,
			PROD_ID_C,
			OFFR_C,
			PRTY_N,
			EMAIL_ADDR_X
		FROM 
			TABLE1 R, TABLE2 O
		<dynamic prepend="WHERE">
		<iterate
		     open=" R.ORD_ID IN (" 
		     close=")" conjunction=",">
		     #orderIdList[]#
		</iterate>
		<isNotEmpty prepend="AND" property="orderIdList">
			R.ORD_ID = O.ORD_ID
		</isNotEmpty>
		</dynamic>
	</select>

It works correctly without the <isNotEmpty> tag. But as soon as I add
the <isNotEmpty> construct it throws a Uncategorized SQL Exception. Can
we not pass a java.util.List property type to <isNotEmpty> tag?

orderIdList is a java.util.List




This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

Mime
View raw message