@SuppressWarnings("unchecked")
    public Predicate on(RelationalPath<E> entity) {
        BooleanBuilder builder = new BooleanBuilder();
        for (int i = 0; i < localColumns.size(); i++) {
            Expression<Object> local = (Expression<Object>) localColumns.get(i);
            Expression<?> foreign = ExpressionUtils.path(local.getType(), entity, foreignColumns.get(i));
            builder.and(ExpressionUtils.eq(local,foreign));
        }
        return builder.getValue();
    }
{@code ForeignKey} defines a foreign key on a table to another table

@author tiwe

@param <E>
querydsl-sql/src/main/java/com/querydsl/sql/ForeignKey.java