//where clause now contains extra joins across all tables
selectStatement.setWhereClause(expression);
}
//normalize the statement at the end, such as assign alias to all tables, and build sorting statement
selectStatement.normalize(session, writeQuery.getDescriptor());
return selectStatement;
}
/**
* Build the sql call from the select statement for selecting the locator