当前位置: 首页 > 工具软件 > JDBI > 使用案例 >

JDBI UnableToCreateStatementException

勾安翔
2023-12-01
  @SqlQuery("SELECT * FROM XXX WHERE 1=1 <if(testList)>AND test IN (<testList>)<endif>")

抛出如下异常:
Caused by: org.jdbi.v3.core.statement.UnableToCreateStatementException: Undefined attribute for token '<endif>'

原因是使用了stringtemplate4模板。应该加上annotation

@UseStringTemplateEngine

注意,里面直接写小于号“<”是违法的,需要转义\\<

 类似资料:

相关阅读

相关文章

相关问答