We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
问题说明: fenix/src/main/java/com/blinkfox/fenix/jpa/FenixJpaQuery.java 中 this.sqlInfo.getSql().replaceFirst(REGX_SELECT_FROM, SELECT_COUNT);
如果 this.sqlInfo.getSql() 查询为: select distinct t.id from t_user
会被替换成 select count(*) as count from t_user
这样导致 list 集合数据 和 count 总数不一样
正确替换sql应该为: select count(distinct t.id) as count from t_user
解决方案: 1.count查询 正则支持识别 distinct: 2.或者提供一个方法/注解属性,类似 countQuery ,能够手动控制是否使用 distinct
目前解决方法是用 countQuery 查询总数
The text was updated successfully, but these errors were encountered:
@masankin 后续可以考虑支持,使用解决方案2 较为合适。
Sorry, something went wrong.
@masankin @blinkfox 根据你们的讨论,我试着做了一版:#24
@masankin 请问你们使用的fenix和jpa版本是多少呢?
这个 issue 新版本有了,我就关了哈
No branches or pull requests
问题说明:
fenix/src/main/java/com/blinkfox/fenix/jpa/FenixJpaQuery.java
中
this.sqlInfo.getSql().replaceFirst(REGX_SELECT_FROM, SELECT_COUNT);
如果 this.sqlInfo.getSql() 查询为:
select distinct t.id from t_user
会被替换成
select count(*) as count from t_user
这样导致 list 集合数据 和 count 总数不一样
正确替换sql应该为:
select count(distinct t.id) as count from t_user
解决方案:
1.count查询 正则支持识别 distinct:
2.或者提供一个方法/注解属性,类似 countQuery ,能够手动控制是否使用 distinct
目前解决方法是用 countQuery 查询总数
The text was updated successfully, but these errors were encountered: