/** * Turn a {@link Result} into a list of {@link Row} */ static final List<Row> rows(Result<?> result) { List<Row> rows = new ArrayList<Row>(result.size()); for (Record record : result) rows.add(record.valuesRow()); return rows; }
@Override public final Condition notIn(Record... records) { RowN[] rows = new RowN[records.length]; for (int i = 0; i < records.length; i++) { rows[i] = (RowN) records[i].valuesRow(); } return notIn(rows); }
@Override public final Condition in(Record... records) { RowN[] rows = new RowN[records.length]; for (int i = 0; i < records.length; i++) { rows[i] = (RowN) records[i].valuesRow(); } return in(rows); }
@Override public final Condition in(Record... records) { RowN[] rows = new RowN[records.length]; for (int i = 0; i < records.length; i++) { rows[i] = (RowN) records[i].valuesRow(); } return in(rows); }
@Override public final Condition notIn(Record... records) { RowN[] rows = new RowN[records.length]; for (int i = 0; i < records.length; i++) { rows[i] = (RowN) records[i].valuesRow(); } return notIn(rows); }
@Override public final Condition compare(Comparator comparator, Record record) { return new RowCondition(this, record.valuesRow(), comparator); }
@Override public final BetweenAndStepN between(Record record) { return between(record.valuesRow()); }
@Override public final BetweenAndStepN betweenSymmetric(Record record) { return betweenSymmetric(record.valuesRow()); }
@Override public final Condition compare(Comparator comparator, Record record) { return new RowCondition(this, record.valuesRow(), comparator); }
@Override public final BetweenAndStepN notBetween(Record record) { return notBetween(record.valuesRow()); }
@Override public final BetweenAndStepN notBetweenSymmetric(Record record) { return notBetweenSymmetric(record.valuesRow()); }
@Override public final BetweenAndStepN betweenSymmetric(Record record) { return betweenSymmetric(record.valuesRow()); }
@Override public final BetweenAndStepN between(Record record) { return between(record.valuesRow()); }
@Override public final Condition isNotDistinctFrom(Record record) { return isNotDistinctFrom(record.valuesRow()); }
@Override public final Condition isDistinctFrom(Record record) { return isDistinctFrom(record.valuesRow()); }
@Override public final BetweenAndStepN notBetweenSymmetric(Record record) { return notBetweenSymmetric(record.valuesRow()); }
@Override public final BetweenAndStepN notBetween(Record record) { return notBetween(record.valuesRow()); }
formatted += ((Record) value).valuesRow().toString();
/** * Use a previously obtained result as a new {@link Table} that can be used * in SQL statements through {@link #values(RowN...)}. * * @see #values(RowN...) */ @Support public static <R extends Record> Table<R> table(Result<R> result) { int size = result.size(); RowN[] rows = new RowN[size]; for (int i = 0; i < size; i++) rows[i] = (RowN) result.get(i).valuesRow(); Field<?>[] fields = result.fields(); String[] columns = new String[fields.length]; for (int i = 0; i < fields.length; i++) columns[i] = fields[i].getName(); // TODO [#2986] Coerce the record type upon the resulting table. return (Table<R>) values(rows).as("v", columns); }
/** * Use a previously obtained result as a new {@link Table} that can be used * in SQL statements through {@link #values(RowN...)}. * * @see #values(RowN...) */ @Support @Transition( name = "TABLE", args = "Result" ) public static <R extends Record> Table<R> table(Result<R> result) { int size = result.size(); RowN[] rows = new RowN[size]; for (int i = 0; i < size; i++) rows[i] = (RowN) result.get(i).valuesRow(); Field<?>[] fields = result.fields(); String[] columns = new String[fields.length]; for (int i = 0; i < fields.length; i++) columns[i] = fields[i].getName(); // TODO [#2986] Coerce the record type upon the resulting table. return (Table<R>) values(rows).as("v", columns); }