ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: Using LIKE clause in SqlMap
Date Wed, 29 Jun 2005 20:33:39 GMT
http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+use+LIKE+in+my+queries%3F

On 6/29/05, Rao, Satish <satish.rao@fmr.com> wrote:
>  
> 
> I have the following entry in my sqlmap: 
> 
>         <select id="listUsersByFilter" parameterClass="com.classname"
> resultMap="list-users-result" cacheModel="user-cache"> 
> 
>             SELECT 
>                 UID, 
>                 AGE, 
>                 FIRSTNAME, 
>                 LASTNAME 
>             FROM 
>                 USERS 
>                 <dynamic prepend="WHERE"> 
>                 <isNotNull prepend="AND" property="lastName"> 
>                         LASTNAME LIKE #lastName# 
>                 </isNotNull> 
>                 <isGreaterThan prepend="AND" property="age"
> compareValue="0"> 
>                         AGE = #age# 
>                 </isGreaterThan> 
>                 </dynamic> 
>         </select> 
> 
> How do I wrap #lastName# with '%'? 
>  
>  
>  
>  
>

Mime
View raw message