use of org.apache.geode.cache.query.internal.CompiledSelect in project geode by apache.
the class ServerCQImpl method constructServerSideQuery.
/**
* Returns parameterized query used by the server. This method replaces Region name with $1 and if
* type is not specified in the query, looks for type from cqattributes and appends into the
* query.
*
* @return String modified query.
*/
private Query constructServerSideQuery() throws QueryException {
InternalCache cache = cqService.getInternalCache();
DefaultQuery locQuery = (DefaultQuery) cache.getLocalQueryService().newQuery(this.queryString);
CompiledSelect select = locQuery.getSimpleSelect();
CompiledIteratorDef from = (CompiledIteratorDef) select.getIterators().get(0);
// WARNING: ASSUMES QUERY WAS ALREADY VALIDATED FOR PROPER "FORM" ON CLIENT;
// THIS VALIDATION WILL NEED TO BE DONE ON THE SERVER FOR NATIVE CLIENTS,
// BUT IS NOT DONE HERE FOR JAVA CLIENTS.
// The query was already checked on the client that the sole iterator is a
// CompiledRegion
this.regionName = ((CompiledRegion) from.getCollectionExpr()).getRegionPath();
from.setCollectionExpr(new CompiledBindArgument(1));
return locQuery;
}
Aggregations