-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgreSQL使用jsonb查询,会把::jsonb变成参数 #30
Milestone
Comments
下个版本 在参数解析时 将会忽略 连续的冒号,并添加字符转义功能。 当前版本有两种临时解决方法: 方法一重写 @Bean
public SnippetResolver mySnippetResolver() {
return new DefaultSnippetResolver() {
@Override
public SqlSnippet resolve(String fragment) {
SqlSnippet snippet = super.resolve(fragment.replace("::", "__"));
snippet.setSql(snippet.getSql().replace("__", "::"));
return snippet;
}
};
} 方法二重新定义 Bean Searcher 的嵌入参数前缀,比如将它修改为 @Bean
public SnippetResolver mySnippetResolver() {
DefaultSnippetResolver resolver = new DefaultSnippetResolver();
resolver.setParamPrefix("$");
return resolver;
} 如果项目中已经有用嵌入参数,使用这种方法需要 修改以前的实体类,要把嵌入参数的 |
已解决,感谢
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sql字段是下面这个样子
t2.task_item_subjoin::jsonb->> 'pointName'
但我在bean里面这样定义,会给转成 t2.task_item_subjoin ?->> 'pointName'
The text was updated successfully, but these errors were encountered: