diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedQueryImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedQueryImpl.java index 4fb8d1360..0eded34ad 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedQueryImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedQueryImpl.java @@ -42,6 +42,7 @@ import org.apache.openjpa.kernel.QueryLanguages; import org.apache.openjpa.kernel.StoreQuery; import org.apache.openjpa.kernel.PreparedQueryCache.Exclusion; import org.apache.openjpa.kernel.exps.QueryExpressions; +import org.apache.openjpa.lib.rop.RangeResultObjectProvider; import org.apache.openjpa.lib.rop.ResultList; import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.util.ImplHelper; @@ -212,10 +213,13 @@ public class PreparedQueryImpl implements PreparedQuery { if (provider instanceof QueryImpl.PackingResultObjectProvider) { provider = ((QueryImpl.PackingResultObjectProvider)provider).getDelegate(); } + if (provider instanceof RangeResultObjectProvider) { + provider = ((RangeResultObjectProvider)provider).getDelegate(); + } if (provider instanceof SelectResultObjectProvider) { return new Object[]{((SelectResultObjectProvider)provider).getSelect(), null}; } - return new Object[]{null, _loc.get("exclude-not-select-rop")}; + return new Object[]{null, _loc.get("exclude-not-select-rop", provider)}; } private SelectImpl extractImplementation(SelectExecutor selector) { diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties index 0a7f1b507..162fb4ff5 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties @@ -163,6 +163,7 @@ exclude-no-sql: because target SQL statement can not be extracted \ from this query. exclude-no-select: because internal select instance can not be extracted \ from this query. -exclude-no-select-rop: because the query result is not obtained by executing \ - a select statement. This can happen if the query was evaluated in-memory. +exclude-not-select-rop: because the query result is not obtained by executing \ + a select statement. This can happen if the query was evaluated in-memory. \ + The result was provided by an instance of {0}. exclude-not-executor: because this query was not executed on a data store.