org.jooq.Row22 Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: https://www.jooq.org/legal/licensing
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
import static org.jooq.SQLDialect.*;
import java.util.Collection;
import java.util.function.Function;
import org.jooq.conf.Settings;
import org.jooq.impl.DSL;
import org.jetbrains.annotations.NotNull;
/**
* A row value expression.
*
* Row value expressions are mainly useful for use in predicates, when comparing
* several values in one go, which can be more elegant than expanding the row
* value expression predicate in other equivalent syntaxes. This is especially
* true for non-equality predicates. For instance, the following two predicates
* are equivalent in SQL:
*
*
* (A, B) > (X, Y)
* (A > X) OR (A = X AND B > Y)
*
*
* Example:
*
*
* // Assuming import static org.jooq.impl.DSL.*;
*
* using(configuration)
* .select()
* .from(CUSTOMER)
* .where(row(CUSTOMER.FIRST_NAME, CUSTOMER.LAST_NAME).in(
* select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME).from(ACTOR)
* ))
* .fetch();
*
*
* 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.
*
* Instances can be created using {@link DSL#row(Object...)} and overloads.
*
* @author Lukas Eder
*/
public interface Row22 extends Row, SelectField> {
// ------------------------------------------------------------------------
// Mapping convenience methods
// ------------------------------------------------------------------------
/**
* A convenience method to define a local {@link Record22} to custom type
* {@link RecordMapper} that can be used when projecting {@link Row} types
* in SELECT
or RETURNING
clauses.
*
* This calls through to {@link #convertFrom(Function)}, offering some
* deconstruction over the {@link Record22}'s individual component values.
*
* Unlike {@link #mapping(Class, Function22)}, this method attempts to work
* without an explicit {@link Class} reference for the underlying
* {@link Converter#toType()}. There may be some edge cases where this
* doesn't work, e.g. when nesting rows in arrays, the class literal is
* required for reflective array creation.
*
* Combine this with e.g. {@link Functions#nullOnAllNull(Function22)} or
* {@link Functions#nullOnAnyNull(Function22)} to achieve null
* safety when mapping nested rows from LEFT JOIN
etc.
*/
@NotNull
SelectField mapping(Function22 super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? super T22, ? extends U> function);
/**
* A convenience method to define a local {@link Record22} to custom type
* {@link RecordMapper} that can be used when projecting {@link Row} types in
* SELECT
or RETURNING
clauses.
*
* This calls through to {@link #convertFrom(Class, Function)}, offering
* some deconstruction over the {@link Record22}'s individual component
* values.
*
* Combine this with e.g. {@link Functions#nullOnAllNull(Function22)} or
* {@link Functions#nullOnAnyNull(Function22)} to achieve null
* safety when mapping nested rows from LEFT JOIN
etc.
*/
@NotNull
SelectField mapping(Class uType, Function22 super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? super T22, ? extends U> function);
// ------------------------------------------------------------------------
// Field accessors
// ------------------------------------------------------------------------
/**
* Get the first field.
*/
@NotNull
Field field1();
/**
* Get the second field.
*/
@NotNull
Field field2();
/**
* Get the third field.
*/
@NotNull
Field field3();
/**
* Get the fourth field.
*/
@NotNull
Field field4();
/**
* Get the fifth field.
*/
@NotNull
Field field5();
/**
* Get the sixth field.
*/
@NotNull
Field field6();
/**
* Get the seventh field.
*/
@NotNull
Field field7();
/**
* Get the eighth field.
*/
@NotNull
Field field8();
/**
* Get the ninth field.
*/
@NotNull
Field field9();
/**
* Get the tenth field.
*/
@NotNull
Field field10();
/**
* Get the eleventh field.
*/
@NotNull
Field field11();
/**
* Get the twelfth field.
*/
@NotNull
Field field12();
/**
* Get the thirteenth field.
*/
@NotNull
Field field13();
/**
* Get the fourteenth field.
*/
@NotNull
Field field14();
/**
* Get the fifteenth field.
*/
@NotNull
Field field15();
/**
* Get the sixteenth field.
*/
@NotNull
Field field16();
/**
* Get the seventeenth field.
*/
@NotNull
Field field17();
/**
* Get the eighteenth field.
*/
@NotNull
Field field18();
/**
* Get the ninteenth field.
*/
@NotNull
Field field19();
/**
* Get the twentieth field.
*/
@NotNull
Field field20();
/**
* Get the twenty-first field.
*/
@NotNull
Field field21();
/**
* Get the twenty-second field.
*/
@NotNull
Field field22();
// ------------------------------------------------------------------------
// Generic comparison predicates
// ------------------------------------------------------------------------
/**
* Compare this row value expression with another row value expression
* using a dynamic comparator.
*
* See the explicit comparison methods for details. Note, not all
* {@link Comparator} types are supported
*
* @see #equal(Row22)
* @see #notEqual(Row22)
* @see #lessThan(Row22)
* @see #lessOrEqual(Row22)
* @see #greaterThan(Row22)
* @see #greaterOrEqual(Row22)
*/
@NotNull
@Support
Condition compare(Comparator comparator, Row22 row);
/**
* Compare this row value expression with a record
* using a dynamic comparator.
*
* See the explicit comparison methods for details. Note, not all
* {@link Comparator} types are supported
*
* @see #equal(Record22)
* @see #notEqual(Record22)
* @see #lessThan(Record22)
* @see #lessOrEqual(Record22)
* @see #greaterThan(Record22)
* @see #greaterOrEqual(Record22)
*/
@NotNull
@Support
Condition compare(Comparator comparator, Record22 record);
/**
* Compare this row value expression with another row value expression
* using a dynamic comparator.
*
* See the explicit comparison methods for details. Note, not all
* {@link Comparator} types are supported
*
* @see #equal(Row22)
* @see #notEqual(Row22)
* @see #lessThan(Row22)
* @see #lessOrEqual(Row22)
* @see #greaterThan(Row22)
* @see #greaterOrEqual(Row22)
*/
@NotNull
@Support
Condition compare(Comparator comparator, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression
* using a dynamic comparator.
*
* See the explicit comparison methods for details. Note, not all
* {@link Comparator} types are supported
*
* @see #equal(Row22)
* @see #notEqual(Row22)
* @see #lessThan(Row22)
* @see #lessOrEqual(Row22)
* @see #greaterThan(Row22)
* @see #greaterOrEqual(Row22)
*/
@NotNull
@Support
Condition compare(Comparator comparator, Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with a subselect
* using a dynamic comparator.
*
* See the explicit comparison methods for details. Note, not all
* {@link Comparator} types are supported
*
* @see #equal(Select)
* @see #notEqual(Select)
* @see #lessThan(Select)
* @see #lessOrEqual(Select)
* @see #greaterThan(Select)
* @see #greaterOrEqual(Select)
*/
@NotNull
@Support
Condition compare(Comparator comparator, Select extends Record22> select);
/**
* Compare this row value expression with a subselect
* using a dynamic comparator.
*
* See the explicit comparison methods for details. Note, not all
* {@link Comparator} types are supported
*
* @see #equal(Select)
* @see #notEqual(Select)
* @see #lessThan(Select)
* @see #lessOrEqual(Select)
* @see #greaterThan(Select)
* @see #greaterOrEqual(Select)
*/
@NotNull
@Support
Condition compare(Comparator comparator, QuantifiedSelect extends Record22> select);
// ------------------------------------------------------------------------
// Equal / Not equal comparison predicates
// ------------------------------------------------------------------------
/**
* Compare this row value expression with another row value expression for
* equality.
*
* Row equality comparison predicates can be emulated in those databases
* that do not support such predicates natively:
* (A, B) = (1, 2)
is equivalent to
* A = 1 AND B = 2
*/
@NotNull
@Support
Condition equal(Row22 row);
/**
* Compare this row value expression with a record for equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition equal(Record22 record);
/**
* Compare this row value expression with another row value expression for
* equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition equal(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition equal(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with a subselect for equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition equal(Select extends Record22> select);
/**
* Compare this row value expression with a subselect for equality.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@NotNull
@Support
Condition equal(QuantifiedSelect extends Record22> select);
/**
* Compare this row value expression with another row value expression for
* equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition eq(Row22 row);
/**
* Compare this row value expression with a record for equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition eq(Record22 record);
/**
* Compare this row value expression with another row value expression for
* equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition eq(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition eq(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with a subselect for equality.
*
* @see #equal(Row22)
*/
@NotNull
@Support
Condition eq(Select extends Record22> select);
/**
* Compare this row value expression with a subselect for equality.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@NotNull
@Support
Condition eq(QuantifiedSelect extends Record22> select);
/**
* Compare this row value expression with another row value expression for
* non-equality.
*
* Row non-equality comparison predicates can be emulated in those
* databases that do not support such predicates natively:
* (A, B) <> (1, 2)
is equivalent to
* NOT(A = 1 AND B = 2)
*/
@NotNull
@Support
Condition notEqual(Row22 row);
/**
* Compare this row value expression with a record for non-equality
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition notEqual(Record22 record);
/**
* Compare this row value expression with another row value expression for.
* non-equality
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition notEqual(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition notEqual(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with a subselect for non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition notEqual(Select extends Record22> select);
/**
* Compare this row value expression with a subselect for non-equality.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@NotNull
@Support
Condition notEqual(QuantifiedSelect extends Record22> select);
/**
* Compare this row value expression with another row value expression for
* non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition ne(Row22 row);
/**
* Compare this row value expression with a record for non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition ne(Record22 record);
/**
* Compare this row value expression with another row value expression for
* non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition ne(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition ne(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with a subselect for non-equality.
*
* @see #notEqual(Row22)
*/
@NotNull
@Support
Condition ne(Select extends Record22> select);
/**
* Compare this row value expression with a subselect for non-equality.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@NotNull
@Support
Condition ne(QuantifiedSelect extends Record22> select);
// ------------------------------------------------------------------------
// [NOT] DISTINCT predicates
// ------------------------------------------------------------------------
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isDistinctFrom(Row22 row);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isDistinctFrom(Record22 record);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isDistinctFrom(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isDistinctFrom(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isDistinctFrom(Select extends Record22> select);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isNotDistinctFrom(Row22 row);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isNotDistinctFrom(Record22 record);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isNotDistinctFrom(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isNotDistinctFrom(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with another row value expression for
* distinctness.
*/
@NotNull
@Support
Condition isNotDistinctFrom(Select extends Record22> select);
// ------------------------------------------------------------------------
// Ordering comparison predicates
// ------------------------------------------------------------------------
/**
* Compare this row value expression with another row value expression for
* order.
*
* Row order comparison predicates can be emulated in those
* databases that do not support such predicates natively:
* (A, B, C) < (1, 2, 3)
is equivalent to
* A < 1 OR (A = 1 AND B < 2) OR (A = 1 AND B = 2 AND C < 3)
*/
@NotNull
@Support
Condition lessThan(Row22 row);
/**
* Compare this row value expression with a record for order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lessThan(Record22 record);
/**
* Compare this row value expression with another row value expression for
* order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lessThan(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lessThan(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field t7, Field t8, Field t9, Field t10, Field t11, Field t12, Field t13, Field t14, Field t15, Field t16, Field t17, Field t18, Field t19, Field t20, Field t21, Field t22);
/**
* Compare this row value expression with a subselect for order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lessThan(Select extends Record22> select);
/**
* Compare this row value expression with a subselect for order.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@NotNull
@Support
Condition lessThan(QuantifiedSelect extends Record22> select);
/**
* Compare this row value expression with another row value expression for
* order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lt(Row22 row);
/**
* Compare this row value expression with a record for order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lt(Record22 record);
/**
* Compare this row value expression with another row value expression for
* order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lt(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22);
/**
* Compare this row value expression with another row value expression for
* order.
*
* @see #lessThan(Row22)
*/
@NotNull
@Support
Condition lt(Field t1, Field t2, Field t3, Field t4, Field t5, Field t6, Field