Ibatis根据id获取拼接好的sql语句案例

//得到sql语句;
public virtual string GetSqlStatement(string statementName, object paramObject)
{
ISqlMapper ISQLMapper = MapperFactory.Get();

IMappedStatement IMstatement = ISQLMapper.GetMappedStatement(statementName);
if (!ISQLMapper.IsSessionStarted)
{
ISQLMapper.OpenConnection();
}

RequestScope RSscope = IMstatement.Statement.Sql.GetRequestScope(IMstatement, paramObject, ISQLMapper.LocalSession);

return RSscope.PreparedStatement.PreparedSql;
}

Ibatis根据id获取拼接好的sql语句案例,布布扣,bubuko.com

Ibatis根据id获取拼接好的sql语句案例

上一篇:MySQL基础之第11章 插入、更新与删除数据


下一篇:WPF非轮询方式更新数据库变化SqlDependency(数据库修改前台自动更新)