private static <T> String tableIdentifierString(HasComparableOperators<T, ?> foreignField) {
        if (hasAlias(foreignField)) {
            return foreignField.tableAlias(); // The alias replaces both schema and table.
        }
        final TableIdentifier<T> tableIdentifier = foreignField.identifier().asTableIdentifier();
        return tableIdentifier.getDbmsId() + "." +
            tableIdentifier.getSchemaId() + "." +
            tableIdentifier.getTableId();
    }
Calculates which reference to use taking "as()" columns into account.
runtime-parent/runtime-join/src/main/java/com/speedment/runtime/join/internal/component/join/AbstractJoinBuilder.java