From 755d0fa1dfa42d8987dd9dc2439f8a1f9c058fe9 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 6 Apr 2008 20:13:22 +0000 Subject: Added support for internal query hints. --- .../amazon/carbonado/repo/jdbc/JDBCStorage.java | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo/jdbc') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java index 942ebee..598f9f6 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java @@ -62,6 +62,7 @@ import com.amazon.carbonado.qe.QueryExecutor; import com.amazon.carbonado.qe.QueryExecutorCache; import com.amazon.carbonado.qe.QueryExecutorFactory; import com.amazon.carbonado.qe.QueryFactory; +import com.amazon.carbonado.qe.QueryHints; import com.amazon.carbonado.qe.SortedQueryExecutor; import com.amazon.carbonado.qe.StandardQuery; import com.amazon.carbonado.qe.StandardQueryFactory; @@ -291,9 +292,10 @@ class JDBCStorage extends StandardQueryFactory protected StandardQuery createQuery(Filter filter, FilterValues values, - OrderingList ordering) + OrderingList ordering, + QueryHints hints) { - return new JDBCQuery(filter, values, ordering, null); + return new JDBCQuery(filter, values, ordering, hints); } public S instantiate(ResultSet rs) throws SQLException { @@ -307,11 +309,15 @@ class JDBCStorage extends StandardQueryFactory } private class ExecutorFactory implements QueryExecutorFactory { + ExecutorFactory() { + } + public Class getStorableType() { return JDBCStorage.this.getStorableType(); } - public QueryExecutor executor(Filter filter, OrderingList ordering) + public QueryExecutor executor(Filter filter, OrderingList ordering, + QueryHints hints) throws RepositoryException { TableAliasGenerator aliasGenerator = new TableAliasGenerator(); @@ -594,9 +600,11 @@ class JDBCStorage extends StandardQueryFactory // Special case for converting character to String. if (mAdapterMethods[i] == null) { if (toType == String.class) { - mAdapterMethods[i] = adapter.findAdaptMethod(jProperty.getType(), Character.class); + mAdapterMethods[i] = adapter + .findAdaptMethod(jProperty.getType(), Character.class); if (mAdapterMethods[i] == null) { - mAdapterMethods[i] = adapter.findAdaptMethod(jProperty.getType(), char.class); + mAdapterMethods[i] = adapter + .findAdaptMethod(jProperty.getType(), char.class); } } } @@ -798,9 +806,9 @@ class JDBCStorage extends StandardQueryFactory JDBCQuery(Filter filter, FilterValues values, OrderingList ordering, - QueryExecutor executor) + QueryHints hints) { - super(filter, values, ordering, executor); + super(filter, values, ordering, hints); } @Override @@ -830,11 +838,10 @@ class JDBCStorage extends StandardQueryFactory return JDBCStorage.this.mExecutorFactory; } - protected StandardQuery newInstance(FilterValues values, - OrderingList ordering, - QueryExecutor executor) + protected StandardQuery newInstance(FilterValues values, OrderingList ordering, + QueryHints hints) { - return new JDBCQuery(values.getFilter(), values, ordering, executor); + return new JDBCQuery(values.getFilter(), values, ordering, hints); } } } -- cgit v1.2.3