首页 > 数据库技术 > 详细

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

时间:2014-03-24 15:44:12      阅读:635      评论:0      收藏:0      [点我收藏+]

//得到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语句案例

原文:http://www.cnblogs.com/guozefeng/p/3620467.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!