From e85d59d3ec0839617a2c4b394301dc6c3c4e31b4 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sat, 25 Jul 2009 18:09:50 +0000 Subject: Query.after and Query.fetchAfter supports subclass parameter. --- .../carbonado/repo/logging/LoggingQuery.java | 46 +++++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo/logging') diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java index c4c8414..eb18933 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java @@ -43,96 +43,119 @@ class LoggingQuery implements Query { mQuery = query; } + @Override public Class getStorableType() { return mQuery.getStorableType(); } + @Override public Filter getFilter() { return mQuery.getFilter(); } + @Override public FilterValues getFilterValues() { return mQuery.getFilterValues(); } + @Override public int getBlankParameterCount() { return mQuery.getBlankParameterCount(); } + @Override public Query with(int value) { return newInstance(mQuery.with(value)); } + @Override public Query with(long value) { return newInstance(mQuery.with(value)); } + @Override public Query with(float value) { return newInstance(mQuery.with(value)); } + @Override public Query with(double value) { return newInstance(mQuery.with(value)); } + @Override public Query with(boolean value) { return newInstance(mQuery.with(value)); } + @Override public Query with(char value) { return newInstance(mQuery.with(value)); } + @Override public Query with(byte value) { return newInstance(mQuery.with(value)); } + @Override public Query with(short value) { return newInstance(mQuery.with(value)); } + @Override public Query with(Object value) { return newInstance(mQuery.with(value)); } + @Override public Query withValues(Object... objects) { return newInstance(mQuery.withValues(objects)); } + @Override public Query and(String filter) throws FetchException { return newInstance(mQuery.and(filter)); } + @Override public Query and(Filter filter) throws FetchException { return newInstance(mQuery.and(filter)); } + @Override public Query or(String filter) throws FetchException { return newInstance(mQuery.or(filter)); } + @Override public Query or(Filter filter) throws FetchException { return newInstance(mQuery.or(filter)); } + @Override public Query not() throws FetchException { return newInstance(mQuery.not()); } + @Override public Query orderBy(String property) throws FetchException, UnsupportedOperationException { return newInstance(mQuery.orderBy(property)); } + @Override public Query orderBy(String... strings) throws FetchException, UnsupportedOperationException { return newInstance(mQuery.orderBy(strings)); } - public Query after(S start) throws FetchException { + @Override + public Query after(T start) throws FetchException { return newInstance(mQuery.after(start)); } + @Override public Cursor fetch() throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -141,6 +164,7 @@ class LoggingQuery implements Query { return mQuery.fetch(); } + @Override public Cursor fetchSlice(long from, Long to) throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -150,7 +174,8 @@ class LoggingQuery implements Query { return mQuery.fetchSlice(from, to); } - public Cursor fetchAfter(S start) throws FetchException { + @Override + public Cursor fetchAfter(T start) throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { log.write("Query.fetchAfter(start) on " + this + ", start: " + start); @@ -158,6 +183,7 @@ class LoggingQuery implements Query { return mQuery.fetchAfter(start); } + @Override public S loadOne() throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -166,6 +192,7 @@ class LoggingQuery implements Query { return mQuery.loadOne(); } + @Override public S tryLoadOne() throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -174,6 +201,7 @@ class LoggingQuery implements Query { return mQuery.tryLoadOne(); } + @Override public void deleteOne() throws PersistException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -182,6 +210,7 @@ class LoggingQuery implements Query { mQuery.deleteOne(); } + @Override public boolean tryDeleteOne() throws PersistException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -190,6 +219,7 @@ class LoggingQuery implements Query { return mQuery.tryDeleteOne(); } + @Override public void deleteAll() throws PersistException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -198,6 +228,7 @@ class LoggingQuery implements Query { mQuery.deleteAll(); } + @Override public long count() throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -206,6 +237,7 @@ class LoggingQuery implements Query { return mQuery.count(); } + @Override public boolean exists() throws FetchException { Log log = mStorage.mLog; if (log.isEnabled()) { @@ -214,34 +246,36 @@ class LoggingQuery implements Query { return mQuery.exists(); } + @Override public boolean printNative() { return mQuery.printNative(); } + @Override public boolean printNative(Appendable app) throws IOException { return mQuery.printNative(app); } + @Override public boolean printNative(Appendable app, int indentLevel) throws IOException { return mQuery.printNative(app, indentLevel); } + @Override public boolean printPlan() { return mQuery.printPlan(); } + @Override public boolean printPlan(Appendable app) throws IOException { return mQuery.printPlan(app); } + @Override public boolean printPlan(Appendable app, int indentLevel) throws IOException { return mQuery.printPlan(app, indentLevel); } - public void appendTo(Appendable appendable) throws IOException { - appendable.append(mQuery.toString()); - } - @Override public String toString() { return mQuery.toString(); -- cgit v1.2.3