ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Logical OR'ing
Date Thu, 13 Dec 2007 16:41:29 GMT
I can't think of a way to do this with the <isNotNull> tag.  The iBATIS
dynamic SQL tags are not a functionally complete language, so there are some
limitations.  Abator generates code that would do it, but it boils down to
this:

<iterate conjunction="or" prepend="where">
  $oredExpression$
</iterate>

Where $oredSolution$ comes from a list of Strings like this: {"x is not
null", "y is not null", "z is not null"}

Not a perfect solution, but workable.

In the past, we've also recommended that these types of calculations remain
in Java.

Jeff Butler



On Dec 13, 2007 9:37 AM, Gurpiar Bassi <gurpiar.bassi@pcmsgroup.com> wrote:

>  I am trying to do the following using IBATIS:
>
>
>
> If(x != null|| y != null || z != null)
>
> {
>
>             //DO SOME SQL
>
> }
>
>
>
> How do I specify this using sql map using <isNotNull>?
>
>
>
>
>
> The PCMS Development Team promoting PCMS Values
> ~Integrity~Respect~Commitment~ ~Continuous Improvement~
>
>
>
> The information contained in this e-mail is intended only for the person
> or entity to which it is addressed and may contain confidential and/or
> privileged material.  If you are not the intended recipient of this e-mail,
> the use of this information or any disclosure, copying or distribution is
> prohibited and may be unlawful.  If you received this in error, please
> contact the sender and delete the material from any computer.  The views
> expressed in this e-mail may not necessarily be the views of the PCMS Group
> plc and should not be taken as authority to carry out any instruction
> contained.   The PCMS Group reserves the right to monitor and examine the
> content of all e-mails.
>
>
>
> The PCMS Group plc is a company registered in England and Wales with
> company number 1459419 whose registered office is at PCMS House, Torwood
> Close, Westwood Business Park, Coventry CV4 8HX, United Kingdom. VAT No: GB
> 705338743
>
>
>

Mime
View raw message