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

Reply via email to