mirror of https://github.com/apache/openjpa.git
OPENJPA-278
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@553629 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8b5a7f68a0
commit
e286a915d5
|
@ -237,7 +237,6 @@ public class ExpressionStoreQuery
|
||||||
* Return the commands that will be sent to the datastore in order
|
* Return the commands that will be sent to the datastore in order
|
||||||
* to execute the query, typically in the database's native language.
|
* 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 base the base type the query should match
|
||||||
* @param types the independent candidate types
|
* @param types the independent candidate types
|
||||||
* @param subclasses true if subclasses should be included in the results
|
* @param subclasses true if subclasses should be included in the results
|
||||||
|
@ -248,7 +247,7 @@ public class ExpressionStoreQuery
|
||||||
* @param range result range
|
* @param range result range
|
||||||
* @return a textual description of the query to execute
|
* @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,
|
ClassMetaData[] types, boolean subclasses, ExpressionFactory[] facts,
|
||||||
QueryExpressions[] parsed, Object[] params, Range range) {
|
QueryExpressions[] parsed, Object[] params, Range range) {
|
||||||
return StoreQuery.EMPTY_STRINGS;
|
return StoreQuery.EMPTY_STRINGS;
|
||||||
|
@ -696,7 +695,7 @@ public class ExpressionStoreQuery
|
||||||
|
|
||||||
public String[] getDataStoreActions(StoreQuery q, Object[] params,
|
public String[] getDataStoreActions(StoreQuery q, Object[] params,
|
||||||
Range range) {
|
Range range) {
|
||||||
return ((ExpressionStoreQuery) q).getDataStoreActions(this, _meta,
|
return ((ExpressionStoreQuery) q).getDataStoreActions(_meta,
|
||||||
_metas, _subs, _facts, _exps, params, range);
|
_metas, _subs, _facts, _exps, params, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue