LogicSetExpression candidateTableExpression = stmt.newTableExpression(candidateTable, candidateTableIdentifier);
ScalarExpression candidateExpression = candidateTable.getIDMapping().newScalarExpression(stmt, candidateTableExpression);
if (allowNulls)
{
// Do LEFT OUTER JOIN since we need to allow nulls in the results
stmt.leftOuterJoin(selectExpression, candidateExpression, candidateTableExpression, true);
}
else
{
// Do INNER JOIN since we don't allow nulls in the results
stmt.innerJoin(selectExpression, candidateExpression, candidateTableExpression, true);