mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#1589 - Refactor internals move SqlQuery sqlDistinct ... to SqlTreeNodeRoot (query plan)
This commit is contained in:
1 parent
82def2710e
commit
0397140e0b
10 files changed
+39
-90
No files matched your search
@@ -146,12 +146,6 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
*/
|
||||
private boolean distinct;
|
||||
|
||||
/**
|
||||
* Set to true internally by Ebean when it needs the DISTINCT keyword added to the query (id
|
||||
* property still expected).
|
||||
*/
|
||||
private boolean sqlDistinct;
|
||||
|
||||
/**
|
||||
* Set to true if this is a future fetch using background threads.
|
||||
*/
|
||||
@@ -772,7 +766,6 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
|
||||
copy.rootTableAlias = rootTableAlias;
|
||||
copy.distinct = distinct;
|
||||
copy.sqlDistinct = sqlDistinct;
|
||||
copy.timeout = timeout;
|
||||
copy.mapKey = mapKey;
|
||||
copy.id = id;
|
||||
@@ -1086,9 +1079,6 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
if (distinct) {
|
||||
sb.append(",dist:");
|
||||
}
|
||||
if (sqlDistinct) {
|
||||
sb.append(",sqlD:");
|
||||
}
|
||||
if (disableLazyLoading) {
|
||||
sb.append(",disLazy:");
|
||||
}
|
||||
@@ -1635,28 +1625,6 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
return countDistinctOrder != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this query uses SQL DISTINCT either explicitly by the user or internally defined
|
||||
* by ebean.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDistinctQuery() {
|
||||
return distinct || sqlDistinct;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSqlDistinct() {
|
||||
return sqlDistinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internally set to use SQL DISTINCT on the query but still have id property included.
|
||||
*/
|
||||
@Override
|
||||
public void setSqlDistinct(boolean sqlDistinct) {
|
||||
this.sqlDistinct = sqlDistinct;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> getBeanType() {
|
||||
return beanType;
|
||||
|
||||
@@ -14,11 +14,14 @@ public class OrmQueryLimitRequest implements SqlLimitRequest {
|
||||
|
||||
private final String sqlOrderBy;
|
||||
|
||||
public OrmQueryLimitRequest(String sql, String sqlOrderBy, SpiQuery<?> ormQuery, DatabasePlatform dbPlatform) {
|
||||
private final boolean distinct;
|
||||
|
||||
public OrmQueryLimitRequest(String sql, String sqlOrderBy, SpiQuery<?> ormQuery, DatabasePlatform dbPlatform, boolean distinct) {
|
||||
this.sql = sql;
|
||||
this.sqlOrderBy = sqlOrderBy;
|
||||
this.ormQuery = ormQuery;
|
||||
this.dbPlatform = dbPlatform;
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +46,7 @@ public class OrmQueryLimitRequest implements SqlLimitRequest {
|
||||
|
||||
@Override
|
||||
public boolean isDistinct() {
|
||||
return ormQuery.isDistinctQuery();
|
||||
return distinct;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user