}
protected boolean applyImplicitParameterValueToSubqueries(String name, Object value, QueryCompilation comp)
{
boolean symbolFound = false;
Symbol sym = null;
// Apply to any subqueries
String[] subqueryNames = comp.getSubqueryAliases();
if (subqueryNames != null)
{
for (int i=0;i<subqueryNames.length;i++)
{
QueryCompilation subCompilation = comp.getCompilationForSubquery(subqueryNames[i]);
sym = subCompilation.getSymbolTable().getSymbol(name);
if (sym != null)
{
symbolFound = true;
if (sym.getValueType() == null && value != null)
{
// Update the compilation providing the type of this parameter
sym.setValueType(value.getClass());
}
else if (sym.getValueType() != null && value != null)
{
if (!QueryUtils.queryParameterTypesAreCompatible(sym.getValueType(), value.getClass()))
{
// Parameter value supplied is not consistent with what the query compilation expects
throw new QueryInvalidParametersException("Parameter " + name +
" needs to be assignable from " + sym.getValueType().getName() +
" yet the value is of type " + value.getClass().getName());
}
}
}
boolean subSymbolFound = applyImplicitParameterValueToSubqueries(name, value, subCompilation);