// It fails when we want to do "a instanceof SUB1 || a instanceof SUB2"
// TODO How do we handle those cases?
JavaTypeMapping m = exprFactory.getMappingForType(boolean.class, true);
if (stmt.getNumberOfUnions() > 0)
{
Class mainCandidateCls = clr.classForName(stmt.getCandidateClassName());
if (type.isAssignableFrom(mainCandidateCls) == not)
{
SQLExpression unionClauseExpr = exprFactory.newLiteral(stmt, m, true).eq(
exprFactory.newLiteral(stmt, m, false));
stmt.whereAnd((BooleanExpression)unionClauseExpr, false);