org.springframework.jdbc.core.JdbcTemplate.isResultsMapCaseInsensitive()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.springframework.jdbc.core.JdbcTemplate.isResultsMapCaseInsensitive()方法的一些代码示例,展示了JdbcTemplate.isResultsMapCaseInsensitive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JdbcTemplate.isResultsMapCaseInsensitive()方法的具体详情如下:
包路径:org.springframework.jdbc.core.JdbcTemplate
类名称:JdbcTemplate
方法名:isResultsMapCaseInsensitive

JdbcTemplate.isResultsMapCaseInsensitive介绍

[英]Return whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.
[中]返回CallableStatement的执行是否会在使用不区分大小写的参数名称的映射中返回结果。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Create a Map instance to be used as the results map.
 * <p>If {@link #resultsMapCaseInsensitive} has been set to true,
 * a {@link LinkedCaseInsensitiveMap} will be created; otherwise, a
 * {@link LinkedHashMap} will be created.
 * @return the results Map instance
 * @see #setResultsMapCaseInsensitive
 * @see #isResultsMapCaseInsensitive
 */
protected Map<String, Object> createResultsMap() {
  if (isResultsMapCaseInsensitive()) {
    return new LinkedCaseInsensitiveMap<>();
  }
  else {
    return new LinkedHashMap<>();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void testCaseInsensitiveResultsMap() throws Exception {
  given(this.callableStatement.execute()).willReturn(false);
  given(this.callableStatement.getUpdateCount()).willReturn(-1);
  given(this.callableStatement.getObject(1)).willReturn("X");
  assertTrue("default should have been NOT case insensitive",
      !this.template.isResultsMapCaseInsensitive());
  this.template.setResultsMapCaseInsensitive(true);
  assertTrue("now it should have been set to case insensitive",
      this.template.isResultsMapCaseInsensitive());
  Map<String, Object> out = this.template.call(
      conn -> conn.prepareCall("my query"), Collections.singletonList(new SqlOutParameter("a", 12)));
  assertThat(out, instanceOf(LinkedCaseInsensitiveMap.class));
  assertNotNull("we should have gotten the result with upper case", out.get("A"));
  assertNotNull("we should have gotten the result with lower case", out.get("a"));
  verify(this.callableStatement).close();
  verify(this.connection).close();
}

代码示例来源:origin: io.bufferslayer/bufferslayer-spring-jdbc

public boolean isResultsMapCaseInsensitive() {
 return delegate.isResultsMapCaseInsensitive();
}

代码示例来源:origin: io.bufferslayer/buffer-spring-jdbc

public boolean isResultsMapCaseInsensitive() {
 return delegate.isResultsMapCaseInsensitive();
}

代码示例来源:origin: org.springframework/org.springframework.jdbc

/**
 * Create a Map instance to be used as results map.
 * <p>If "isResultsMapCaseInsensitive" has been set to true,
 * a linked case-insensitive Map will be created.
 * @return the results Map instance
 * @see #setResultsMapCaseInsensitive
 */
protected Map<String, Object> createResultsMap() {
  if (isResultsMapCaseInsensitive()) {
    return new LinkedCaseInsensitiveMap<Object>();
  }
  else {
    return new LinkedHashMap<String, Object>();
  }
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Create a Map instance to be used as the results map.
 * <p>If {@link #resultsMapCaseInsensitive} has been set to true,
 * a {@link LinkedCaseInsensitiveMap} will be created; otherwise, a
 * {@link LinkedHashMap} will be created.
 * @return the results Map instance
 * @see #setResultsMapCaseInsensitive
 * @see #isResultsMapCaseInsensitive
 */
protected Map<String, Object> createResultsMap() {
  if (isResultsMapCaseInsensitive()) {
    return new LinkedCaseInsensitiveMap<>();
  }
  else {
    return new LinkedHashMap<>();
  }
}

相关文章