本文整理了Java中org.jdbi.v3.core.Handle.setSqlParser()
方法的一些代码示例,展示了Handle.setSqlParser()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Handle.setSqlParser()
方法的具体详情如下:
包路径:org.jdbi.v3.core.Handle
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!