本文整理了Java中org.jdbi.v3.core.statement.Query.defineNamedBindings
方法的一些代码示例,展示了Query.defineNamedBindings
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.defineNamedBindings
方法的具体详情如下:
包路径:org.jdbi.v3.core.statement.Query
类名称:Query
方法名:defineNamedBindings
暂无
代码示例来源:origin: jdbi/jdbi
@Test
public void testDefineStrings() {
assertThat(
db.getSharedHandle().createQuery("select <a> from values(:a) union all select <b> from values(:b)")
.defineNamedBindings()
.bindBean(new DefinedBean())
.mapTo(boolean.class)
.list())
.isEqualTo(Arrays.asList(true, false));
}
代码示例来源:origin: jdbi/jdbi
@Test
public void testDefineBoolean() {
db.getSharedHandle().setTemplateEngine(new StringTemplateEngine());
assertThat(
db.getSharedHandle().createQuery("select <a> from values(:a) <if(b)>where false=:b<endif>")
.defineNamedBindings()
.bindBean(new DefinedBean())
.mapTo(boolean.class)
.findOnly())
.isTrue();
}
内容来源于网络,如有侵权,请联系作者删除!