I've found following issue for mybatis: SQL parameter substitution functionality differs substantially from string substitution functionality.
Does it exist a workaround, eg. using java code (static methods?) in #{} expression?
I need to create following statement:
<foreach item="c" collection="filter.getFilter()" separator=" AND " open="(" close=")">
<bind name="column" value="_parameter.mappingWhere(c.colCode)"/>
<bind name="operator" value="_parameter.conditionOperator(c.condition)"/>
<bind name="value" value="_parameter.conditionValue(c.condition, c.value)"/>
${column} ${operator} #{value}
</foreach>
but the value always takes the last value.
${}
instead of#{}
and handle sql injection problem outside?