#788 - Deprecate findRowCount() ... add findCount(). Effectively renaming findRowCount() to findCount()

This commit is contained in:
Robin Bygrave
2016-07-31 16:39:23 +12:00
parent ed41e58073
commit 7c83010df1
5 changed files with 138 additions and 134 deletions
@@ -1152,12 +1152,16 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
}
public <T> int findRowCount(Query<T> query, Transaction t) {
public <T> int findCount(Query<T> query, Transaction t) {
SpiQuery<T> copy = ((SpiQuery<T>) query).copy();
return findRowCountWithCopy(copy, t);
}
public <T> int findRowCount(Query<T> query, Transaction t) {
return findCount(query, t);
}
public <T> int findRowCountWithCopy(Query<T> query, Transaction t) {
SpiOrmQueryRequest<T> request = createQueryRequest(Type.ROWCOUNT, query, t);
@@ -1213,7 +1217,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
}
public <T> FutureRowCount<T> findFutureRowCount(Query<T> q, Transaction t) {
public <T> FutureRowCount<T> findFutureCount(Query<T> q, Transaction t) {
SpiQuery<T> copy = ((SpiQuery<T>) q).copy();
copy.setFutureFetch(true);
@@ -1228,6 +1232,10 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
return queryFuture;
}
public <T> FutureRowCount<T> findFutureRowCount(Query<T> q, Transaction t) {
return findFutureCount(q, t);
}
public <T> FutureIds<T> findFutureIds(Query<T> query, Transaction t) {
SpiQuery<T> copy = ((SpiQuery<T>) query).copy();
@@ -1048,11 +1048,16 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
}
@Override
public int findRowCount() {
public int findCount() {
// a copy of this query is made in the server
// as the query needs to modified (so we modify
// the copy rather than this query instance)
return server.findRowCount(this, null);
return server.findCount(this, null);
}
@Override
public int findRowCount() {
return findCount();
}
@Override
@@ -1119,9 +1124,14 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
return server.findFutureList(this, null);
}
@Override
public FutureRowCount<T> findFutureCount() {
return server.findFutureCount(this, null);
}
@Override
public FutureRowCount<T> findFutureRowCount() {
return server.findFutureRowCount(this, null);
return findFutureCount();
}
@Override