ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nilesh Bhattad" <nil...@outlinesys.com>
Subject change in property value inside <select/>
Date Tue, 18 Jan 2005 17:22:55 GMT
Hello,
 
Is there a way to change a property value before it is plugged in to the
select statement?
 
<select id="search" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
          select ConsultantId, BlackListed, FirstName, LastName,
HomeTelephone, EmailAddress, InterviewGrade, TotalYrsOfExp from
Consultant
            <dynamic prepend=" where ">
                <isNotEmpty property="FirstName" prepend=" and
">FirstName like #FirstName#</isNotEmpty>
                <isNotEmpty property="LastName" prepend=" and ">LastName
like #LastName#</isNotEmpty>
                <isNotEmpty property="ActiveInactive" prepend=" and
">ActiveInactive like #ActiveInactive#</isNotEmpty>
            </dynamic>    
          order by FirstName, LastName
     </select>
 
For example, in the above case, when FirstName is present, is there a
way to attach '%' at the end of the FirstName's value and then perform
the select operation?
 
For some reason, in the calling program, I won't be able to attach '%'
at the end of the search fields. Well, somehow I could achieve that
before the iBatis call is made, but I'm kindof hesitant to go with that
approach. So I was wondering is there any way to handle it in iBatis
layer. Any help is highly appreciated.
 
Thanks
Nilesh

Mime
View raw message