// Need to join to the instanceof class (where appropriate)
// TODO RDBMS-71 Only join on the UNION select that it is applicable to
if (table instanceof DatastoreClass)
{
DatastoreClass ct = (DatastoreClass)table;
if (ct.managesClass(instanceofClass.getName()))
{
// This type is managed in this table so must be an instance
return new BooleanLiteral(qs, mapping, true).eq(new BooleanLiteral(qs, mapping, true));
}
else