I have written a Dynamic Sql query as shown below:

Only
"select KEY_NAME from pm_duplicate_key"
is being executed, what abt the remaining part of the select query with where clause ?,
is their any fault in the code ?
can any one please sort it out ...


CODE:

<
sqlMapnamespace="DuplicateKeysDualListKey">




<resultMapid="result"class="com.palm.idea.client.model.DuplicateKeysDualListKey">


<resultproperty="keyName"column="KEY_NAME"columnIndex="1"/>

</resultMap>



<
selectid="getDuplicateKeysDualListKey"resultMap="result">


select
KEY_NAME
from pm_duplicate_key
<dynamicprepend="where">

<isNotEmptyproperty="layoutId">

LAYOUT_ID=#layoutId#
</isNotEmpty>

</dynamic>

order by dup_key_id

</
select>


</sqlMap>