ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rao, Satish" <satish....@fmr.com>
Subject Using LIKE clause in SqlMap
Date Wed, 29 Jun 2005 20:32:32 GMT
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