mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
Fix for #140 - Add some support for RawSql findRowCount, remove BeanCollection.hasMoreRows()
This commit is contained in:
1 parent
db17ddd069
commit
af6dbd0dbe
19 files changed
+148
-166
No files matched your search
@@ -125,6 +125,10 @@ public class CQueryBuilder implements Constants {
|
||||
|
||||
// always set the order by to null for row count query
|
||||
query.setOrder(null);
|
||||
if (query.isRawSql()) {
|
||||
query.setFirstRow(0);
|
||||
query.setMaxRows(0);
|
||||
}
|
||||
|
||||
ManyWhereJoins manyWhereJoins = query.getManyWhereJoins();
|
||||
|
||||
@@ -158,7 +162,7 @@ public class CQueryBuilder implements Constants {
|
||||
SqlTree sqlTree = createSqlTree(request, predicates);
|
||||
SqlLimitResponse s = buildSql(sqlSelect, request, predicates, sqlTree);
|
||||
String sql = s.getSql();
|
||||
if (hasMany) {
|
||||
if (hasMany || query.isRawSql()) {
|
||||
sql = "select count(*) from ( " + sql + ")";
|
||||
if (selectCountWithAlias) {
|
||||
sql += " as c";
|
||||
|
||||
Reference in new issue
Block a user