protected String getTestJoinResult() {
return "SELECT OtherTable.MyIndex, RefIndex, Company FROM MySchema.OtherTable JOIN MySchema.MyTable ON RefIndex=MyTable.MyIndex WHERE OtherTable.MyIndex=?";
}
protected SelectStatement getJoinStatement() {
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();