Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.kernel;
import java.util.Collection;
import java.util.Map;
import org.apache.commons.collections.map.LinkedMap;
import org.apache.openjpa.kernel.exps.AggregateListener;
import org.apache.openjpa.kernel.exps.Constant;
import org.apache.openjpa.kernel.exps.FilterListener;
import org.apache.openjpa.kernel.exps.Value;
import org.apache.openjpa.lib.util.OrderedMap;
import org.apache.openjpa.meta.ClassMetaData;
import org.apache.openjpa.meta.FieldMetaData;
/**
* A query execution context.
*
* @author Abe White
* @since 0.4.0
*/
public interface QueryContext {
/**
* Return the query for this context. Note that the query will be
* unavailable in remote contexts, and this method may throw an exception
* to that effect.
*/
public Query getQuery();
/**
* The persistence context for the query.
*/
public StoreContext getStoreContext();
/**
* Return the fetch configuration for this query.
*/
public FetchConfiguration getFetchConfiguration();
/**
* Returns the operation that this query will be expected to perform.
*
* @see QueryOperations
* @since 0.4.0
*/
public int getOperation();
/**
* The query language.
*/
public String getLanguage();
/**
* The query string.
*/
public String getQueryString();
/**
* Return the candidate collection, or null if an
* extent was specified instead of a collection.
*/
public Collection> getCandidateCollection();
/**
* Return the class of the objects that this query will return,
* or null if this information is not available / not relevant.
*/
public Class> getCandidateType();
/**
* Whether query results will include subclasses of the candidate class.
*/
public boolean hasSubclasses();
/**
* Set the candidate type.
*/
public void setCandidateType(Class> cls, boolean subs);
/**
* Whether the query has been marked read-only.
*/
public boolean isReadOnly();
/**
* Whether the query has been marked read-only.
*/
public void setReadOnly(boolean readOnly);
/**
* The unique flag.
*/
public boolean isUnique();
/**
* Specify that the query will return only 1
* result, rather than a collection. The execute method will return null
* if the query result size is 0.
*
* @since 0.3.0
*/
public void setUnique(boolean unique);
/**
* Affirms if this query results are distinct instance(s).
*
* @since 2.0.0
*/
public boolean isDistinct();
/**
* Scope of a mapping from the result data to its object representation.
*/
public Class> getResultMappingScope();
/**
* Name of a mapping from the result data to its object representation.
*/
public String getResultMappingName();
/**
* Name and scope of a mapping from the result data to its object
* representation.
*/
public void setResultMapping(Class> scope, String name);
/**
* Returns the result class that has been set through
* {@link #setResultType}, or null if none.
*/
public Class> getResultType();
/**
* Specify the type of object in which the result of evaluating this query.
*
* @since 0.3.0
*/
public void setResultType(Class> cls);
/**
* Return the 0-based start index for the returned results.
*/
public long getStartRange();
/**
* Return the 0-based exclusive end index for the returned results,
* or {@link Long#MAX_VALUE} for no limit.
*/
public long getEndRange();
/**
* Set the range of results to return.
*
* @param start 0-based inclusive start index
* @param end 0-based exclusive end index, or
* {@link Long#MAX_VALUE} for no limit
* @since 0.3.2
*/
public void setRange(long start, long end);
/**
* The parameter declaration.
*/
public String getParameterDeclaration();
/**
* Declared parameters, for query languages that use them.
*/
public void declareParameters(String params);
/**
* Return a map of parameter name to type for this query. The returned
* map will iterate in the order that the parameters were declared or,
* if they're implicit, used.
*/
public OrderedMap