@Override @Deprecated @SafeVarargs public final Field<T> greatest(T... others) { return DSL.greatest(this, Tools.fields(others).toArray(EMPTY_FIELD)); }
@Override @Deprecated @SafeVarargs public final Field<T> least(T... others) { return DSL.least(this, Tools.fields(others).toArray(EMPTY_FIELD)); }
/** * Get the concat(value[, value, ...]) function. * * @see #concat(Field...) */ @Support public static Field<String> concat(String... values) { return concat(Tools.fields(values).toArray(EMPTY_FIELD)); }
@Override @Deprecated public final Field<String> concat(String... values) { return DSL.concat(Tools.combine(this, Tools.fields(values).toArray(EMPTY_FIELD))); }
/** * Create a row value expression of degree <code>N > 22</code>. * <p> * Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Support public static RowN row(Object... values) { return row(Tools.fields(values).toArray(EMPTY_FIELD)); }
@Override @Deprecated @SafeVarargs public final Field<T> coalesce(T option, T... options) { return DSL.coalesce(this, Tools.combine(Tools.field(option, this), Tools.fields(options, this).toArray(EMPTY_FIELD))); }
@Support public static <T> Field<T> choose(Field<Integer> index, T... values) { return choose(index, (Field<T>[]) Tools.fields(values).toArray(EMPTY_FIELD)); }
private final List<? extends Field<?>> seekValues(Object[] values) { if (getQuery() instanceof SelectQueryImpl) { SelectQueryImpl<R> query = (SelectQueryImpl<R>) getQuery(); List<Field<?>> fields = query.getOrderBy().fields(); DataType<?>[] types = new DataType[fields.size()]; for (int i = 0; i < types.length; i++) types[i] = fields.get(i).getDataType(); return Tools.fields(values, types); } else return Tools.fields(values); }
@Override public final SelectSeekLimitStep<R> seekBefore(Object... values) { getQuery().addSeekBefore(Tools.fields(values)); return this; }
/** * The <code>COALESCE(value1, value2, ... , value n)</code> function. * * @see #coalesce(Field, Field...) */ @Support public static <T> Field<T> coalesce(T value, T... values) { return coalesce0(Tools.field(value), Tools.fields(values).toArray(EMPTY_FIELD)); }
@Override public final MergeImpl values(Object... values) { // [#1541] The VALUES() clause is also supported in the H2-specific // syntax, in case of which, the USING() was not added if (using == null) { upsertStyle = true; getUpsertValues().addAll(Tools.fields(values, getUpsertFields().toArray(EMPTY_FIELD))); } else { Field<?>[] fields = notMatchedInsert.fields().toArray(EMPTY_FIELD); notMatchedInsert.set(Tools.fields(values, fields)); } return this; }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Row valuesRow() { return new RowImpl(Tools.fields(intoArray(), fields.fields.fields())); }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Row valuesRow() { return new RowImpl(Tools.fields(intoArray(), fields.fields.fields())); }
@Override public final RowImpl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> valuesRow() { return new RowImpl(Tools.fields(intoArray(), fields.fields())); }
@Override public final Condition compare(Comparator comparator, Object... values) { return compare(comparator, row(Tools.fields(values, dataTypes()))); }
@SuppressWarnings("unchecked") @Override public final Condition in(T... values) { // [#3362] Prevent "rogue" API usage when using Field<Object>.in(Object... values) if (isAccidentalSelect(values)) return in((Select<Record1<T>>) values[0]); // [#3347] Prevent "rogue" API usage when using Field<Object>.in(Object... values) if (isAccidentalCollection(values)) return in((Collection<?>) values[0]); return in(Tools.fields(values, this).toArray(EMPTY_FIELD)); }
@SuppressWarnings("unchecked") @Override public final Condition notIn(T... values) { // [#3362] Prevent "rogue" API usage when using Field<Object>.in(Object... values) if (isAccidentalSelect(values)) return notIn((Select<Record1<T>>) values[0]); // [#3347] Prevent "rogue" API usage when using Field<Object>.in(Object... values) if (isAccidentalCollection(values)) return notIn((Collection<?>) values[0]); return notIn(Tools.fields(values, this).toArray(EMPTY_FIELD)); }
/** * Gets the Oracle-style * <code>DECODE(expression, search, result[, search , result]... [, default])</code> * function. * * @see #decode(Field, Field, Field, Field[]) */ @Support public static <Z, T> Field<Z> decode(T value, T search, Z result, Object... more) { return decode(Tools.field(value), Tools.field(search), Tools.field(result), Tools.fields(more).toArray(EMPTY_FIELD)); }
@Override public final Condition and(Record record) { RowN r = new RowImpl(Tools.fields(record.intoArray(), record.fields())); return and(r); }
@Override @Deprecated public final <Z> Field<Z> decode(T search, Z result, Object... more) { Field<Z> r = Tools.field(result); DataType<?>[] types = new DataType[more.length]; for (int i = 0; i < types.length - 1; i = i + 2) { types[i] = getDataType(); types[i + 1] = r.getDataType(); } if (types.length % 2 == 1) { types[types.length - 1] = r.getDataType(); } return DSL.decode(this, Tools.field(search, this), r, Tools.fieldArray(Tools.fields(more, types))); }