summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/repo
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-04-06 20:13:22 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-04-06 20:13:22 +0000
commit755d0fa1dfa42d8987dd9dc2439f8a1f9c058fe9 (patch)
tree24c43ecbcbf227017a3b16097a9fa804eb9b52ce /src/main/java/com/amazon/carbonado/repo
parent9d2d8ef94b327743f97ed40736de3e517c92a4e8 (diff)
Added support for internal query hints.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java29
1 files changed, 18 insertions, 11 deletions
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<S extends Storable> extends StandardQueryFactory<S>
protected StandardQuery<S> createQuery(Filter<S> filter,
FilterValues<S> values,
- OrderingList<S> ordering)
+ OrderingList<S> 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<S extends Storable> extends StandardQueryFactory<S>
}
private class ExecutorFactory implements QueryExecutorFactory<S> {
+ ExecutorFactory() {
+ }
+
public Class<S> getStorableType() {
return JDBCStorage.this.getStorableType();
}
- public QueryExecutor<S> executor(Filter<S> filter, OrderingList<S> ordering)
+ public QueryExecutor<S> executor(Filter<S> filter, OrderingList<S> ordering,
+ QueryHints hints)
throws RepositoryException
{
TableAliasGenerator aliasGenerator = new TableAliasGenerator();
@@ -594,9 +600,11 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
// 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<S extends Storable> extends StandardQueryFactory<S>
JDBCQuery(Filter<S> filter,
FilterValues<S> values,
OrderingList<S> ordering,
- QueryExecutor<S> executor)
+ QueryHints hints)
{
- super(filter, values, ordering, executor);
+ super(filter, values, ordering, hints);
}
@Override
@@ -830,11 +838,10 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
return JDBCStorage.this.mExecutorFactory;
}
- protected StandardQuery<S> newInstance(FilterValues<S> values,
- OrderingList<S> ordering,
- QueryExecutor<S> executor)
+ protected StandardQuery<S> newInstance(FilterValues<S> values, OrderingList<S> ordering,
+ QueryHints hints)
{
- return new JDBCQuery(values.getFilter(), values, ordering, executor);
+ return new JDBCQuery(values.getFilter(), values, ordering, hints);
}
}
}