在IbatiS的select中有两个占位符 # 和 $
我们先看一个查询语句:
select * from user where Name = #userName#;
ibatis解析成:select * from user where Name = ? 这样的语句,然后在填充参数。
select * from user where Name = ‘$userName$’
ibatis解析成:select * from user where Name = '传过来的值' (传过来的值直接填充)
本文详细解释了IbatiS框架中#和$两种参数占位符的不同用法。通过具体的SQL示例说明了它们在预编译语句及字符串拼接上的差异。
707

被折叠的 条评论
为什么被折叠?



