From fab442a9017019131c41fe067cefb18c98fb9bc9 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 8 Sep 2006 23:11:32 +0000 Subject: Renamed getStorage to getRootStorage. --- .../com/amazon/carbonado/qe/StandardQuery.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java index a347b66..3f48efa 100644 --- a/src/main/java/com/amazon/carbonado/qe/StandardQuery.java +++ b/src/main/java/com/amazon/carbonado/qe/StandardQuery.java @@ -78,7 +78,7 @@ public abstract class StandardQuery extends AbstractQuery } public Class getStorableType() { - return getStorage().getStorableType(); + return getRootStorage().getStorableType(); } public Filter getFilter() { @@ -86,7 +86,7 @@ public abstract class StandardQuery extends AbstractQuery if (values != null) { return values.getFilter(); } - return Filter.getOpenFilter(getStorage().getStorableType()); + return Filter.getOpenFilter(getStorableType()); } public FilterValues getFilterValues() { @@ -144,9 +144,9 @@ public abstract class StandardQuery extends AbstractQuery FilterValues values = mValues; Query newQuery; if (values == null) { - newQuery = getStorage().query(filter); + newQuery = getRootStorage().query(filter); } else { - newQuery = getStorage().query(values.getFilter().and(filter)); + newQuery = getRootStorage().query(values.getFilter().and(filter)); newQuery = newQuery.withValues(values.getValues()); } return mOrdering.size() == 0 ? newQuery : newQuery.orderBy(mOrdering.asStringArray()); @@ -157,7 +157,7 @@ public abstract class StandardQuery extends AbstractQuery if (values == null) { throw new IllegalStateException("Query is already guaranteed to fetch everything"); } - Query newQuery = getStorage().query(values.getFilter().or(filter)); + Query newQuery = getRootStorage().query(values.getFilter().or(filter)); newQuery = newQuery.withValues(values.getValues()); return mOrdering.size() == 0 ? newQuery : newQuery.orderBy(mOrdering.asStringArray()); } @@ -165,9 +165,9 @@ public abstract class StandardQuery extends AbstractQuery public Query not() throws FetchException { FilterValues values = mValues; if (values == null) { - return new EmptyQuery(getStorage(), mOrdering); + return new EmptyQuery(getRootStorage(), mOrdering); } - Query newQuery = getStorage().query(values.getFilter().not()); + Query newQuery = getRootStorage().query(values.getFilter().not()); newQuery = newQuery.withValues(values.getSuppliedValues()); return mOrdering.size() == 0 ? newQuery : newQuery.orderBy(mOrdering.asStringArray()); } @@ -190,7 +190,7 @@ public abstract class StandardQuery extends AbstractQuery return fetch(); } - Class storableType = getStorage().getStorableType(); + Class storableType = getStorableType(); Filter orderFilter = Filter.getClosedFilter(storableType); Filter lastSubFilter = Filter.getOpenFilter(storableType); BeanPropertyAccessor accessor = BeanPropertyAccessor.forClass(storableType); @@ -295,7 +295,7 @@ public abstract class StandardQuery extends AbstractQuery @Override public int hashCode() { - int hash = getStorage().hashCode() * 31; + int hash = getRootStorage().hashCode() * 31; if (mValues != null) { hash += mValues.hashCode(); } @@ -309,7 +309,7 @@ public abstract class StandardQuery extends AbstractQuery } if (obj instanceof StandardQuery) { StandardQuery other = (StandardQuery) obj; - return getStorage().equals(other.getStorage()) && + return getRootStorage().equals(other.getRootStorage()) && (mValues == null ? (other.mValues == null) : (mValues.equals(other.mValues))); } return false; @@ -351,9 +351,9 @@ public abstract class StandardQuery extends AbstractQuery } /** - * Return the Storage object that the query is operating on. + * Return the root Storage object that the query is operating on. */ - protected abstract Storage getStorage(); + protected abstract Storage getRootStorage(); /** * Enter a transaction as needed by the standard delete operation, or null -- cgit v1.2.3