}
/** <p>Test for a JOIN statement.</p>
*/
public void testJoin() {
Table table = getPrimaryKeyTable();
Table otherTable = getForeignKeyTable(table);
SelectStatement statement = otherTable.getSelectStatement();
SelectTableReference tableReference = statement.getSelectTableReference();
JoinReference joinReference = tableReference.join(table);
TableReference refLocal = tableReference;
TableReference refRef = tableReference.getRightJoinedTableReference();
joinReference.getOn().addJoin((ForeignKey) otherTable.getForeignKeys().next(),
refLocal, refRef);
CombinedConstraint cc = statement.getWhere();
BooleanConstraint bc = cc.createEQ();
bc.addPart(tableReference.newColumnReference("MyIndex"));
bc.addPlaceholder();