if (join.getParent().getPrimaryKey() == null) {
output.reportFailure(new AISValidationFailure(
new JoinParentNoExplicitPK (join.getParent().getName())));
continue;
}
TableIndex parentPK= join.getParent().getPrimaryKey().getIndex();
if (parentPK.getKeyColumns().size() != join.getJoinColumns().size()) {
output.reportFailure(new AISValidationFailure(
new JoinColumnMismatchException (join.getJoinColumns().size(),
join.getChild().getName(),
join.getParent().getName(),
parentPK.getKeyColumns().size())));
continue;
}
Iterator<JoinColumn> joinColumns = join.getJoinColumns().iterator();
for (IndexColumn parentPKColumn : parentPK.getKeyColumns()) {
JoinColumn joinColumn = joinColumns.next();
if (parentPKColumn.getColumn() != joinColumn.getParent()) {
output.reportFailure(new AISValidationFailure (
new JoinToWrongColumnsException (
join.getChild().getName(),
joinColumn.getParent().getName(),
parentPK.getTable().getName(), parentPKColumn.getColumn().getName())));
}
}
}
}