throw new NucleusException(method + "(num1, num2) where num1 is instanceof " + param1.getClass().getName() + " but should be integer");
}
}
else if (param1 instanceof ParameterExpression)
{
ParameterExpression paramExpr = (ParameterExpression)param1;
Object val = QueryUtils.getValueForParameterExpression(eval.getParameterValues(), paramExpr);
if (val instanceof Number)
{
param1Value = ((Number)val).intValue();
}
else
{
throw new NucleusException(method + "(num1, num2) where num1 is instanceof " + param1.getClass().getName() + " but should be integer");
}
}
else if (param1 instanceof Literal)
{
Object val = ((Literal)param1).getLiteral();
if (val instanceof Number)
{
param1Value = ((Number)val).intValue();
}
else
{
throw new NucleusException(method + "(num1, num2) where num1 is instanceof " + param1.getClass().getName() + " but should be integer");
}
}
else
{
throw new NucleusException(method + "(num1, num2) where num1 is instanceof " + param1.getClass().getName() + " not supported");
}
Object param2 = expr.getArguments().get(1);
int param2Value = -1;
if (param2 instanceof PrimaryExpression)
{
PrimaryExpression primExpr = (PrimaryExpression)param2;
Object val = eval.getValueForPrimaryExpression(primExpr);
if (val instanceof Number)
{
param2Value = ((Number)val).intValue();
}
else
{
throw new NucleusException(method + "(num1, num2) where num2 is instanceof " + param2.getClass().getName() + " but should be integer");
}
}
else if (param2 instanceof ParameterExpression)
{
ParameterExpression paramExpr = (ParameterExpression)param2;
Object val = QueryUtils.getValueForParameterExpression(eval.getParameterValues(), paramExpr);
if (val instanceof Number)
{
param2Value = ((Number)val).intValue();
}