Multiple compareValue in isEqual?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple compareValue in isEqual?

jenniferG
Is it possible to add multiple compare values to the isEqual dynamic statement?  For example I have

<isEqual property="test" compareValue="A">

But I would like to check the "test" property for both "A" and "B".  How do I do this?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple compareValue in isEqual?

bgoodin
This question should be posted to the user list.

It is not possible to check multiple values in one tag. However, you can create multiple tags. This is less than ideal but, it does work. We should be addressing these type of things as we work towards iB3. Feel free to create a JIRA ticket for this feature ehancement.

Example of multiple tags:
<isEqual property="test" compareValue="A">
... content
</isEqual>

<isEqual property="test" compareValue="B">
... identical content
</isEqual>

Brandon

On 1/23/07, jenniferG <[hidden email]> wrote:

Is it possible to add multiple compare values to the isEqual dynamic
statement?  For example I have

<isEqual property="test" compareValue="A">

But I would like to check the "test" property for both "A" and "B".  How do
I do this?
--
View this message in context: http://www.nabble.com/Multiple-compareValue-in-isEqual--tf3065249.html#a8525246
Sent from the iBATIS - Dev mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Multiple compareValue in isEqual?

Clinton Begin-3
you can use the <sql> tag to eliminate the duplicate "identical
content", if the content is long or you have more than 2 conditions.
otherwise duplicating it isn't the end of the world.

On 1/23/07, Brandon Goodin <[hidden email]> wrote:

> This question should be posted to the user list.
>
> It is not possible to check multiple values in one tag. However, you can
> create multiple tags. This is less than ideal but, it does work. We should
> be addressing these type of things as we work towards iB3. Feel free to
> create a JIRA ticket for this feature ehancement.
>
> Example of multiple tags:
> <isEqual property="test" compareValue="A">
> ... content
> </isEqual>
>
>  <isEqual property="test" compareValue="B">
>  ... identical content
>  </isEqual>
>
> Brandon
>
>
> On 1/23/07, jenniferG <[hidden email]> wrote:
> >
> > Is it possible to add multiple compare values to the isEqual dynamic
> > statement?  For example I have
> >
> > <isEqual property="test" compareValue="A">
> >
> > But I would like to check the "test" property for both "A" and "B".  How
> do
> > I do this?
> > --
> > View this message in context:
> http://www.nabble.com/Multiple-compareValue-in-isEqual--tf3065249.html#a8525246
> > Sent from the iBATIS - Dev mailing list archive at Nabble.com.
> >
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Multiple compareValue in isEqual?

Thomas Duffey
In reply to this post by bgoodin

On Jan 23, 2007, at 11:09 AM, Brandon Goodin wrote:

This question should be posted to the user list.

It is not possible to check multiple values in one tag. However, you can create multiple tags. This is less than ideal but, it does work. We should be addressing these type of things as we work towards iB3. Feel free to create a JIRA ticket for this feature ehancement.

Example of multiple tags:
<isEqual property="test" compareValue="A">
... content
</isEqual>

<isEqual property="test" compareValue="B">
... identical content
</isEqual>

Are there any plans to make the iBATIS SQL Map logic syntax more flexible?  Often when I write a SQL map I find myself wishing for JSTL-like syntax to write something like:

<c:if test="${test == 'A' or test == 'B'}">
... content
</c:if>

Tom

On 1/23/07, jenniferG <[hidden email]> wrote:

Is it possible to add multiple compare values to the isEqual dynamic
statement?  For example I have

<isEqual property="test" compareValue="A">

But I would like to check the "test" property for both "A" and "B".  How do
I do this?
--
View this message in context: http://www.nabble.com/Multiple-compareValue-in-isEqual--tf3065249.html#a8525246
Sent from the iBATIS - Dev mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Re: Multiple compareValue in isEqual?

bgoodin
I am all for it and there is discussion about it in a couple locations:

iBATIS 3.0 Whiteboard:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/iBATIS+3.0+Whitebo

Improved Dynamic SQL Whiteboard:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/Improved+Dynamic+SQL+Whiteboard

Brandon

On 1/23/07, Tom Duffey <[hidden email]> wrote:

On Jan 23, 2007, at 11:09 AM, Brandon Goodin wrote:

This question should be posted to the user list.

It is not possible to check multiple values in one tag. However, you can create multiple tags. This is less than ideal but, it does work. We should be addressing these type of things as we work towards iB3. Feel free to create a JIRA ticket for this feature ehancement.

Example of multiple tags:
<isEqual property="test" compareValue="A">
... content
</isEqual>

<isEqual property="test" compareValue="B">
... identical content
</isEqual>

Are there any plans to make the iBATIS SQL Map logic syntax more flexible?  Often when I write a SQL map I find myself wishing for JSTL-like syntax to write something like:

<c:if test="${test == 'A' or test == 'B'}">
... content
</c:if>

Tom

On 1/23/07, jenniferG <[hidden email]> wrote:

Is it possible to add multiple compare values to the isEqual dynamic
statement?  For example I have

<isEqual property="test" compareValue="A">

But I would like to check the "test" property for both "A" and "B".  How do
I do this?
--
View this message in context: <a href="http://www.nabble.com/Multiple-compareValue-in-isEqual--tf3065249.html#a8525246" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.nabble.com/Multiple-compareValue-in-isEqual--tf3065249.html#a8525246
Sent from the iBATIS - Dev mailing list archive at <a href="http://Nabble.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: Multiple compareValue in isEqual?

Mehak
In reply to this post by jenniferG
Hi Jennifer
I also want to use multiple comapre values in Ibatis. Did you find any other solution to it?
I would appreciate your help.

Thanks
Mehak

jenniferG wrote
Is it possible to add multiple compare values to the isEqual dynamic statement?  For example I have

<isEqual property="test" compareValue="A">

But I would like to check the "test" property for both "A" and "B".  How do I do this?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple compareValue in isEqual?

lwpro2
actually you can use nested <isEqual> tags, as
                        <isEqual prepend="AND" property="testA" compareValue="A">
                               (1==1
                <isEqual prepend="AND" property="testB" compareValue="B">
                        BRN_PROD_D_ASSO.BUY_ALLOWED='Y'
            </isEqual>
                                )
                        </isEqual>

Mehak wrote
Hi Jennifer
I also want to use multiple comapre values in Ibatis. Did you find any other solution to it?
I would appreciate your help.

Thanks
Mehak

jenniferG wrote
Is it possible to add multiple compare values to the isEqual dynamic statement?  For example I have

<isEqual property="test" compareValue="A">

But I would like to check the "test" property for both "A" and "B".  How do I do this?