You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of SQL fragment include replaces placeholders only in text nodes of XML. If placeholder is placed for example in "test" attribute of "if" it is not replaced. It looks like a bug in the implementation which scans only "child" nodes but it had "attribute" branch too which has not been ever used.
Example usage:
<sqlid="select-part">
SELECT d.field1, d.field2, ..., d.fieldN
<iftest="${source} == 'active'">
, null AS archivedDate
FROM active_table d
</if>
<iftest="${source} == 'archive'">
, d.achived AS archivedDate
FROM archive_table d
</if>
LEFT JOIN ...
ORDER BY ...
</sql>
<selectid="fetchData"resultMap="Data">
<includerefid="select-part">
<propertyname="source"value="active"/>
</include>
UNION ALL
<includerefid="select-part">
<propertyname="source"value="archive"/>
</include>
</select>
@c340c340 bind cannot be used in this case. Current implementation replaces include parameters only in text nodes in XML, attributes are completely ignored (so value attribute of bind element would be ignored the same way as attributes in if, for, or similar). Or could you provide some working example?
Current implementation of SQL fragment include replaces placeholders only in text nodes of XML. If placeholder is placed for example in "test" attribute of "if" it is not replaced. It looks like a bug in the implementation which scans only "child" nodes but it had "attribute" branch too which has not been ever used.
Example usage:
(example taken from original question on StackOverflow)
The text was updated successfully, but these errors were encountered: