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


Java StatementType.CALLABLE属性代码示例

本文整理汇总了Java中org.apache.ibatis.mapping.StatementType.CALLABLE属性的典型用法代码示例。如果您正苦于以下问题:Java StatementType.CALLABLE属性的具体用法?Java StatementType.CALLABLE怎么用?Java StatementType.CALLABLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.ibatis.mapping.StatementType的用法示例。


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

示例1: handleLocallyCachedOutputParameters

private void handleLocallyCachedOutputParameters(MappedStatement ms, CacheKey key, Object parameter, BoundSql boundSql) {
  if (ms.getStatementType() == StatementType.CALLABLE) {
    final Object cachedParameter = localOutputParameterCache.getObject(key);
    if (cachedParameter != null && parameter != null) {
      final MetaObject metaCachedParameter = configuration.newMetaObject(cachedParameter);
      final MetaObject metaParameter = configuration.newMetaObject(parameter);
      for (ParameterMapping parameterMapping : boundSql.getParameterMappings()) {
        if (parameterMapping.getMode() != ParameterMode.IN) {
          final String parameterName = parameterMapping.getProperty();
          final Object cachedValue = metaCachedParameter.getValue(parameterName);
          metaParameter.setValue(parameterName, cachedValue);
        }
      }
    }
  }
}
 
开发者ID:txazo,项目名称:mybatis,代码行数:16,代码来源:BaseExecutor.java

示例2: queryFromDatabase

private <E> List<E> queryFromDatabase(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql) throws SQLException {
  List<E> list;
  // 源码解析: 填充本地缓存
  localCache.putObject(key, EXECUTION_PLACEHOLDER);
  try {
    // 源码解析: 查询结果集
    list = doQuery(ms, parameter, rowBounds, resultHandler, boundSql);
  } finally {
    // 源码解析: 清除本地缓存
    localCache.removeObject(key);
  }
  // 源码解析: 查询结果集放入本地缓存
  localCache.putObject(key, list);
  if (ms.getStatementType() == StatementType.CALLABLE) {
    localOutputParameterCache.putObject(key, parameter);
  }
  return list;
}
 
开发者ID:txazo,项目名称:mybatis,代码行数:18,代码来源:BaseExecutor.java

示例3: queryFromDatabase

private <E> List<E> queryFromDatabase(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql) throws SQLException {
  List<E> list;
  //先向缓存中放入占位符???
  localCache.putObject(key, EXECUTION_PLACEHOLDER);
  try {
    list = doQuery(ms, parameter, rowBounds, resultHandler, boundSql);
  } finally {
    //最后删除占位符
    localCache.removeObject(key);
  }
  //加入缓存
  localCache.putObject(key, list);
  //如果是存储过程,OUT参数也加入缓存
  if (ms.getStatementType() == StatementType.CALLABLE) {
    localOutputParameterCache.putObject(key, parameter);
  }
  return list;
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:18,代码来源:BaseExecutor.java

示例4: bindingLog

private void bindingLog(Invocation invocation) throws SQLException {

        Object[] args = invocation.getArgs();
        MappedStatement ms = (MappedStatement) args[0];
        Object parameterObject = args[1];
        StatementType statementType = ms.getStatementType();
        if (StatementType.PREPARED == statementType || StatementType.CALLABLE == statementType) {
            Log statementLog = ms.getStatementLog();
            if (isDebugEnable(statementLog)) {
                BoundSql boundSql = ms.getBoundSql(parameterObject);

                String sql = boundSql.getSql();
                List<String> parameterList = getParameters(ms, parameterObject, boundSql);
                debug(statementLog, "==> BindingLog: " + bindLogFormatter.format(sql, parameterList));
            }
        }
    }
 
开发者ID:naver,项目名称:pinpoint,代码行数:17,代码来源:BindingLogPlugin32.java

示例5: getNameAnnotatedWithXMLResultMap

@Select("{call sptest.getname(#{id,jdbcType=INTEGER,mode=IN})}")
@ResultMap("nameResult")
@Options(statementType = StatementType.CALLABLE)
Name getNameAnnotatedWithXMLResultMap(Integer id);
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:4,代码来源:SPMapper.java

示例6:

@Select({ "{call sptest.arraytest(", "#{ids,mode=IN,jdbcType=ARRAY},", "#{requestedRows,jdbcType=INTEGER,mode=OUT},", "#{returnedIds,mode=OUT,jdbcType=ARRAY})}" })
@ResultMap("nameResult")
@Options(statementType = StatementType.CALLABLE)
List<Name> getNamesWithArrayAnnotatedWithXMLResultMap(Map<String, Object> parms);
 
开发者ID:txazo,项目名称:mybatis,代码行数:4,代码来源:SPMapper.java

示例7: ensureNoOutParams

private void ensureNoOutParams(MappedStatement ms, Object parameter, BoundSql boundSql) {
  if (ms.getStatementType() == StatementType.CALLABLE) {
    for (ParameterMapping parameterMapping : boundSql.getParameterMappings()) {
      if (parameterMapping.getMode() != ParameterMode.IN) {
        throw new ExecutorException("Caching stored procedures with OUT params is not supported.  Please configure useCache=false in " + ms.getId() + " statement.");
      }
    }
  }
}
 
开发者ID:shurun19851206,项目名称:mybaties,代码行数:9,代码来源:CachingExecutor.java

示例8: queryFromDatabase

private <E> List<E> queryFromDatabase(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql) throws SQLException {
  List<E> list;
  localCache.putObject(key, EXECUTION_PLACEHOLDER);
  try {
    //4. 执行查询,返回List 结果,然后将查询的结果放入缓存之中
    list = doQuery(ms, parameter, rowBounds, resultHandler, boundSql);
  } finally {
    localCache.removeObject(key);
  }
  localCache.putObject(key, list);
  if (ms.getStatementType() == StatementType.CALLABLE) {
    localOutputParameterCache.putObject(key, parameter);
  }
  return list;
}
 
开发者ID:toulezu,项目名称:play,代码行数:15,代码来源:BaseExecutor.java

示例9: queryFromDatabase

private <E> List<E> queryFromDatabase(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, CacheKey key, BoundSql boundSql) throws SQLException {
  List<E> list;
  localCache.putObject(key, EXECUTION_PLACEHOLDER);
  try {
    list = doQuery(ms, parameter, rowBounds, resultHandler, boundSql);
  } finally {
    localCache.removeObject(key);
  }
  localCache.putObject(key, list);
  if (ms.getStatementType() == StatementType.CALLABLE) {
    localOutputParameterCache.putObject(key, parameter);
  }
  return list;
}
 
开发者ID:mybatis,项目名称:mybatis-3,代码行数:14,代码来源:BaseExecutor.java

示例10: ensureNoOutParams

private void ensureNoOutParams(MappedStatement ms, BoundSql boundSql) {
  if (ms.getStatementType() == StatementType.CALLABLE) {
    for (ParameterMapping parameterMapping : boundSql.getParameterMappings()) {
      if (parameterMapping.getMode() != ParameterMode.IN) {
        throw new ExecutorException("Caching stored procedures with OUT params is not supported.  Please configure useCache=false in " + ms.getId() + " statement.");
      }
    }
  }
}
 
开发者ID:mybatis,项目名称:mybatis-3,代码行数:9,代码来源:CachingExecutor.java

示例11: getNamesAnnotated

@Select({ "{call sptest.getnames(", "#{lowestId,jdbcType=INTEGER,mode=IN},", "#{totalRows,jdbcType=INTEGER,mode=OUT})}" })
@Results({ @Result(column = "ID", property = "id"), @Result(column = "FIRST_NAME", property = "firstName"), @Result(column = "LAST_NAME", property = "lastName") })
@Options(statementType = StatementType.CALLABLE)
List<Name> getNamesAnnotated(Map<String, Object> parms);
 
开发者ID:txazo,项目名称:mybatis,代码行数:4,代码来源:SPMapper.java

示例12: GetOrderDetailsAndHeaders

@Select(value = "{ call GetOrderDetailsAndHeaders() }")
@ResultMap("orderDetailResultMap")
@Options(statementType= StatementType.CALLABLE, resultSets="orderDetailResultSet,orderHeaderResultSet")
List<OrderDetail> getOrderDetailsWithHeadersAnnotationBased();
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:4,代码来源:Mapper.java

示例13: adderAsSelectAnnotated

@Select({ "{call sptest.adder(", "#{addend1,jdbcType=INTEGER,mode=IN},", "#{addend2,jdbcType=INTEGER,mode=IN},", "#{sum,jdbcType=INTEGER,mode=OUT})}" })
@Options(statementType = StatementType.CALLABLE)
Object adderAsSelectAnnotated(Parameter parameter);
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:3,代码来源:SPMapper.java

示例14: adderAsUpdateAnnotated

@Update({ "{call sptest.adder(", "#{addend1,jdbcType=INTEGER,mode=IN},", "#{addend2,jdbcType=INTEGER,mode=IN},", "#{sum,jdbcType=INTEGER,mode=OUT})}" })
@Options(statementType = StatementType.CALLABLE)
void adderAsUpdateAnnotated(Parameter parameter);
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:3,代码来源:SPMapper.java

示例15: getNameAnnotated

@Select("{call sptest.getname(#{id,jdbcType=INTEGER,mode=IN})}")
@Results({ @Result(column = "ID", property = "id"), @Result(column = "FIRST_NAME", property = "firstName"), @Result(column = "LAST_NAME", property = "lastName") })
@Options(statementType = StatementType.CALLABLE)
Name getNameAnnotated(Integer id);
 
开发者ID:yuexiahandao,项目名称:MybatisCode,代码行数:4,代码来源:SPMapper.java


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