You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by somebody <va...@gmail.com> on 2008/12/30 13:14:49 UTC
Problem with isEqual in select clause
Hi,
We are using Ibatis with Spring Framework. My requirement is...
I should make a query dynamically based on a parameter..Lets say 'type'
I have put the parameter type in a map(HashMap).
Please find below the query:
<select id="searchQuery" resultClass="java.util.HashMap"
parameterClass="java.util.Map">
Select a,b,c
<isEqual property="type" compareValue="C" >
,d
</isEqual>
<isEqual property="type" compareValue="B" >
,f
</isEqual>
From A,B
</select>
Now,the problem is...If I give type as 'C' for the first time..the select
clause works fine...
Even if I give type as 'B' also..its selecting the columns as if the type is
'C'.
Its not taking the parameter 'type' dynamically. I will be thankful, if you
can give any inputs to resolve this issue.
Regards,
vijay
--
View this message in context: http://www.nabble.com/Problem-with-isEqual-in-select-clause-tp21216463p21216463.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Problem with isEqual in select clause
Posted by somebody <va...@gmail.com>.
Thanks a lot Rikki...
It worked...
Regards,
Vijay
Rikki Bindra wrote:
>
> Try,
>
> <select id="searchQuery" resultClass="java.util.HashMap"
> parameterClass="java.util.Map" remapResults="true">
> Select a,b,c
> <isEqual property="type" compareValue="C" >
> ,d
> </isEqual>
> <isEqual property="type" compareValue="B" >
> ,f
> </isEqual>
> From A,B
> </select>
>
> Regards,
> Rikki Bindra
> ____________________________________________
> Experience certainty. IT Services
> Business Solutions
> Outsourcing
> ____________________________________________
>
>
>
> somebody <va...@gmail.com>
> 12/30/2008 05:44 PM
> Please respond to
> user-java@ibatis.apache.org
>
>
> To
> user-java@ibatis.apache.org
> cc
>
> Subject
> Problem with isEqual in select clause
>
>
>
>
>
>
>
> Hi,
>
> We are using Ibatis with Spring Framework. My requirement is...
> I should make a query dynamically based on a parameter..Lets say 'type'
>
> I have put the parameter type in a map(HashMap).
>
> Please find below the query:
>
> <select id="searchQuery" resultClass="java.util.HashMap"
> parameterClass="java.util.Map">
> Select a,b,c
> <isEqual property="type" compareValue="C" >
> ,d
> </isEqual>
> <isEqual property="type" compareValue="B" >
> ,f
> </isEqual>
> From A,B
> </select>
>
> Now,the problem is...If I give type as 'C' for the first time..the select
> clause works fine...
> Even if I give type as 'B' also..its selecting the columns as if the type
> is
> 'C'.
> Its not taking the parameter 'type' dynamically. I will be thankful, if
> you
> can give any inputs to resolve this issue.
>
> Regards,
> vijay
> --
> View this message in context:
> http://www.nabble.com/Problem-with-isEqual-in-select-clause-tp21216463p21216463.html
>
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ForwardSourceID:NT0000AEBA
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-isEqual-in-select-clause-tp21216463p21216611.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Problem with isEqual in select clause
Posted by Rikki Bindra <ri...@tcs.com>.
Try,
<select id="searchQuery" resultClass="java.util.HashMap"
parameterClass="java.util.Map" remapResults="true">
Select a,b,c
<isEqual property="type" compareValue="C" >
,d
</isEqual>
<isEqual property="type" compareValue="B" >
,f
</isEqual>
From A,B
</select>
Regards,
Rikki Bindra
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
somebody <va...@gmail.com>
12/30/2008 05:44 PM
Please respond to
user-java@ibatis.apache.org
To
user-java@ibatis.apache.org
cc
Subject
Problem with isEqual in select clause
Hi,
We are using Ibatis with Spring Framework. My requirement is...
I should make a query dynamically based on a parameter..Lets say 'type'
I have put the parameter type in a map(HashMap).
Please find below the query:
<select id="searchQuery" resultClass="java.util.HashMap"
parameterClass="java.util.Map">
Select a,b,c
<isEqual property="type" compareValue="C" >
,d
</isEqual>
<isEqual property="type" compareValue="B" >
,f
</isEqual>
From A,B
</select>
Now,the problem is...If I give type as 'C' for the first time..the select
clause works fine...
Even if I give type as 'B' also..its selecting the columns as if the type
is
'C'.
Its not taking the parameter 'type' dynamically. I will be thankful, if
you
can give any inputs to resolve this issue.
Regards,
vijay
--
View this message in context:
http://www.nabble.com/Problem-with-isEqual-in-select-clause-tp21216463p21216463.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
ForwardSourceID:NT0000AEBA
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you