当前位置: 首页>>代码示例>>Java>>正文


Java DynamicContext类代码示例

本文整理汇总了Java中org.apache.ibatis.scripting.xmltags.DynamicContext的典型用法代码示例。如果您正苦于以下问题:Java DynamicContext类的具体用法?Java DynamicContext怎么用?Java DynamicContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DynamicContext类属于org.apache.ibatis.scripting.xmltags包,在下文中一共展示了DynamicContext类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBoundSql

import org.apache.ibatis.scripting.xmltags.DynamicContext; //导入依赖的package包/类
public BoundSql getBoundSql(Object parameterObject) {
    DynamicContext context = new DynamicContext(configuration, parameterObject);
    rootSqlNode.apply(context);
    SqlSourceBuilder sqlSourceParser = new SqlSourceBuilder(configuration);
    Class<?> parameterType = parameterObject == null ? Object.class : parameterObject.getClass();
    SqlSource sqlSource = sqlSourceParser.parse(context.getSql(), parameterType, context.getBindings());
    if (count) {
        sqlSource = getCountSqlSource(configuration, sqlSource, parameterObject);
    } else {
        sqlSource = getPageSqlSource(configuration, sqlSource, parameterObject);
    }
    BoundSql boundSql = sqlSource.getBoundSql(parameterObject);
    // 设置条件参数
    for (Map.Entry<String, Object> entry : context.getBindings().entrySet()) {
        boundSql.setAdditionalParameter(entry.getKey(), entry.getValue());
    }
    return boundSql;
}
 
开发者ID:PekingGo,项目名称:ipayquery,代码行数:19,代码来源:SqlUtil.java

示例2: getBoundSql

import org.apache.ibatis.scripting.xmltags.DynamicContext; //导入依赖的package包/类
public BoundSql getBoundSql(Object parameterObject) {
    DynamicContext context = new DynamicContext(configuration, parameterObject);
    rootSqlNode.apply(context);
    SqlSourceBuilder sqlSourceParser = new SqlSourceBuilder(configuration);
    Class<?> parameterType = parameterObject == null ? Object.class : parameterObject.getClass();
    SqlSource sqlSource = sqlSourceParser.parse(context.getSql(), parameterType, context.getBindings());
    BoundSql boundSql = sqlSource.getBoundSql(parameterObject);
    //设置条件参数
    for (Map.Entry<String, Object> entry : context.getBindings().entrySet()) {
        boundSql.setAdditionalParameter(entry.getKey(), entry.getValue());
    }
    BoundSqlSqlSource boundSqlSqlSource = new BoundSqlSqlSource(boundSql);
    if (count) {
        boundSqlSqlSource = getCountSqlSource(boundSqlSqlSource);
    } else {
        boundSqlSqlSource = getPageSqlSource(configuration, boundSqlSqlSource);
    }
    return boundSqlSqlSource.getBoundSql();
}
 
开发者ID:panhainan,项目名称:BookHouse,代码行数:20,代码来源:SqlUtil.java

示例3: getDefaultBoundSql

import org.apache.ibatis.scripting.xmltags.DynamicContext; //导入依赖的package包/类
@Override
protected BoundSql getDefaultBoundSql(Object parameterObject) {
    DynamicContext context = new DynamicContext(configuration, parameterObject);
    rootSqlNode.apply(context);
    SqlSourceBuilder sqlSourceParser = new SqlSourceBuilder(configuration);
    Class<?> parameterType = parameterObject == null ? Object.class : parameterObject.getClass();
    SqlSource sqlSource = sqlSourceParser.parse(context.getSql(), parameterType, context.getBindings());
    sqlSource = new OrderByStaticSqlSource((StaticSqlSource) sqlSource);
    BoundSql boundSql = sqlSource.getBoundSql(parameterObject);
    //设置条件参数
    for (Map.Entry<String, Object> entry : context.getBindings().entrySet()) {
        boundSql.setAdditionalParameter(entry.getKey(), entry.getValue());
    }
    return boundSql;
}
 
开发者ID:xushaomin,项目名称:apple-orm,代码行数:16,代码来源:PageDynamicSqlSource.java

示例4: getSql

import org.apache.ibatis.scripting.xmltags.DynamicContext; //导入依赖的package包/类
private static String getSql(Configuration configuration, SqlNode rootSqlNode) {
  DynamicContext context = new DynamicContext(configuration, null);
  rootSqlNode.apply(context);
  return context.getSql();
}
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:6,代码来源:RawSqlSource.java


注:本文中的org.apache.ibatis.scripting.xmltags.DynamicContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。