diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java index 825aa75f3..c683ba390 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java @@ -237,7 +237,6 @@ public class ExpressionStoreQuery * Return the commands that will be sent to the datastore in order * to execute the query, typically in the database's native language. * - * @param ex current executor * @param base the base type the query should match * @param types the independent candidate types * @param subclasses true if subclasses should be included in the results @@ -248,7 +247,7 @@ public class ExpressionStoreQuery * @param range result range * @return a textual description of the query to execute */ - protected String[] getDataStoreActions(Executor ex, ClassMetaData base, + protected String[] getDataStoreActions(ClassMetaData base, ClassMetaData[] types, boolean subclasses, ExpressionFactory[] facts, QueryExpressions[] parsed, Object[] params, Range range) { return StoreQuery.EMPTY_STRINGS; @@ -696,7 +695,7 @@ public class ExpressionStoreQuery public String[] getDataStoreActions(StoreQuery q, Object[] params, Range range) { - return ((ExpressionStoreQuery) q).getDataStoreActions(this, _meta, + return ((ExpressionStoreQuery) q).getDataStoreActions(_meta, _metas, _subs, _facts, _exps, params, range); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestDataStoreActions.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestDataStoreActions.java new file mode 100644 index 000000000..5b603edd5 --- /dev/null +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestDataStoreActions.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.query; + +import org.apache.openjpa.persistence.test.SingleEMTestCase; +import org.apache.openjpa.persistence.OpenJPAQuery; +import org.apache.openjpa.persistence.simple.AllFieldTypes; + +public class TestDataStoreActions + extends SingleEMTestCase { + + @Override + public void setUp() { + setUp(AllFieldTypes.class); + } + + public void testDataStoreActions() { + OpenJPAQuery q = em.createQuery("select o from AllFieldTypes o"); + String[] sql = q.getDataStoreActions(null); + assertEquals(1, sql.length); + assertTrue(sql[0].startsWith("SELECT")); + } +}