Skip to content
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

自动组装SQL方法未对特定数据库的特定关键字进行处理 #38

Open
LiuXin8835 opened this issue Apr 8, 2021 · 2 comments

Comments

@LiuXin8835
Copy link

在Oralce数据库中,使用双引号括起来特定的关键词就能在表的字段中使用该关键字例如“comment”,而在使用SQL查询时也必须使用双引号将特定关键字括起来。
如果没有括起来会报“缺少表达式”错误。
目前SUID的ObjToSQL方法生成comment时不会将关键词括起来,并且未给指定SQL方言的方法(或者从DataSource里面去扣关键词进行判断),会导致生成的SQL语句不正确。
期望BeeFactory方法增加选择特定Oracle方言的方法,并且允许扩展设定方言(传入一个替换语句的方法,例如Map<String,String>在Select表字段的时候碰到Map的KEY就用value代替)

@automvc
Copy link
Owner

automvc commented Apr 8, 2021

不建议用关键字作为字段名 , 可以选用其它的词,如comment可以用 remark代替。

@automvc
Copy link
Owner

automvc commented Apr 8, 2021

ObjToSQL接口是可以自己实现的,实现后,可以在HoneyFactory里配置自己的实现类,也可以用spring bean配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants