org.jdbi.v3.core.Handle.setSqlParser()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(110)

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

Handle.setSqlParser介绍

暂无

代码示例

代码示例来源:origin: jdbi/jdbi

@Test
public void testSomethingByIterableHandleVoidWithEmptyList() {
  final List<String> log = new ArrayList<>();
  handle.setSqlParser(new LoggingParser(log));
  final SomethingByIterableHandleVoid s = handle.attach(SomethingByIterableHandleVoid.class);
  final List<Something> out = s.get(new ArrayList<>());
  assertThat(out).isEmpty();
  assertThat(log).hasSize(1).allMatch(e -> e.contains(" where id in ();"));
}

代码示例来源:origin: jdbi/jdbi

@Test
public void testSomethingByIterableHandleVoidWithNull() {
  final List<String> log = new ArrayList<>();
  handle.setSqlParser(new LoggingParser(log));
  final SomethingByIterableHandleVoid s = handle.attach(SomethingByIterableHandleVoid.class);
  final List<Something> out = s.get(null);
  assertThat(out).isEmpty();
  assertThat(log).hasSize(1).allMatch(e -> e.contains(" where id in ();"));
}

代码示例来源:origin: prestodb/presto

public MaterializedResult execute(Session session, @Language("SQL") String sql, List<? extends Type> resultTypes)
{
  MaterializedResult materializedRows = new MaterializedResult(
      handle.setSqlParser(new RawSqlParser())
          .setTemplateEngine((template, context) -> template)
          .createQuery(sql)
          .map(rowMapper(resultTypes))
          .list(),
      resultTypes);
  return materializedRows;
}

代码示例来源:origin: com.facebook.presto/presto-tests

public MaterializedResult execute(Session session, @Language("SQL") String sql, List<? extends Type> resultTypes)
{
  MaterializedResult materializedRows = new MaterializedResult(
      handle.setSqlParser(new RawSqlParser())
          .setTemplateEngine((template, context) -> template)
          .createQuery(sql)
          .map(rowMapper(resultTypes))
          .list(),
      resultTypes);
  return materializedRows;
}

代码示例来源:origin: prestosql/presto

public MaterializedResult execute(Session session, @Language("SQL") String sql, List<? extends Type> resultTypes)
{
  MaterializedResult materializedRows = new MaterializedResult(
      handle.setSqlParser(new RawSqlParser())
          .setTemplateEngine((template, context) -> template)
          .createQuery(sql)
          .map(rowMapper(resultTypes))
          .list(),
      resultTypes);
  return materializedRows;
}

相关文章