org.jooq.Field 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.CUBRID;
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.DUCKDB;
// ...
import static org.jooq.SQLDialect.FIREBIRD;
// ...
import static org.jooq.SQLDialect.H2;
// ...
import static org.jooq.SQLDialect.HSQLDB;
import static org.jooq.SQLDialect.IGNITE;
// ...
// ...
import static org.jooq.SQLDialect.MARIADB;
// ...
import static org.jooq.SQLDialect.MYSQL;
// ...
// ...
// ...
import static org.jooq.SQLDialect.POSTGRES;
// ...
// ...
// ...
import static org.jooq.SQLDialect.SQLITE;
// ...
// ...
// ...
// ...
// ...
import static org.jooq.SQLDialect.TRINO;
// ...
import static org.jooq.SQLDialect.YUGABYTEDB;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Map;
import java.util.function.Function;
import org.jooq.conf.Settings;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.types.Interval;
// ...
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* A column expression.
*
* Column expressions or fields can be used in a variety of SQL statements and
* clauses, including (non-exhaustive list):
*
* SELECT
clause, e.g. through {@link DSL#select(SelectField)}
* (every {@link Field} is a subtype of {@link SelectField})
* WHERE
clause, e.g. through
* {@link SelectWhereStep#where(Field)} (Field<Boolean>
can
* behave like a {@link Condition}, regardless if your RDBMS supports the
* BOOLEAN
type)
* GROUP BY
clause, e.g. through
* {@link SelectGroupByStep#groupBy(GroupField...)} (every {@link Field} is a
* subtype of {@link GroupField})
* HAVING
clause, e.g. through
* {@link SelectHavingStep#having(Field)}
* ORDER BY
clause, e.g. through
* {@link SelectOrderByStep#orderBy(OrderField)} (every {@link Field} is a
* subtype of {@link OrderField})
* - When creating a {@link Condition}, e.g. through
* {@link Field#eq(Field)}
* - As a function argument, e.g. through {@link DSL#abs(Field)}
* - Many more...
*
*
* Example:
*
*
*
*
* // Assuming import static org.jooq.impl.DSL.*;
*
* using(configuration)
* .select(ACTOR.LAST_NAME) // Field reference
* .from(ACTOR)
* .groupBy(ACTOR.LAST_NAME) // Field reference
* .orderBy(ACTOR.LAST_NAME) // Field reference
* .fetch();
*
*
*
* Instances can be created using a variety of ways, including:
*
* - {@link DSL#field(String)} and overloads for plain SQL field
* expression.
* - {@link DSL#field(Name)} and overloads for field identifier
* references.
* - {@link DSL#field(Condition)} for predicates as fields.
* - {@link DSL#field(Select)} for correlated subqueries.
* - {@link TableField} referenced from generated tables
* - {@link DSL#val(Object)} and overloads to create bind variables
* explicitly
* - {@link DSL#inline(Object)} and overloads to create inline values
* (constants, literals) explicitly
*
*
* @param The field type
* @author Lukas Eder
*/
public non-sealed interface Field
extends
SelectField,
GroupField,
OrderField,
FieldOrRow,
FieldOrRowOrSelect,
FieldOrConstraint,
TableElement
{
// ------------------------------------------------------------------------
// API
// ------------------------------------------------------------------------
/**
* The name of the field.
*
* The name is any of these:
*
* - The formal name of the field, if it is a physical table/view
* field
* - The alias of an aliased field
* - A generated / unspecified value for any other expression
* - The name of a parameter if it is a named {@link Param}
*
*/
@NotNull
@Override
String getName();
/**
* The comment given to the field.
*
* If this Field
is a generated field from your database, it
* may provide its DDL comment through this method. All other column
* expressions return the empty string ""
here, never
* null
.
*/
@NotNull
@Override
String getComment();
/**
* Create an alias for this field.
*
* Note that the case-sensitivity of the returned field depends on
* {@link Settings#getRenderQuotedNames()}. By default, field aliases are
* quoted, and thus case-sensitive in many SQL dialects!
*
* This works like {@link #as(String)}, except that field aliases are
* provided by a function. This is useful, for instance, to prefix all
* columns with a common prefix (on {@link Table#as(String, Function)}):
*
*
* MY_TABLE.as("t1", f -> "prefix_" + f.getName());
*
*
* And then to use the same function also for individual fields:
*
*
* MY_TABLE.MY_COLUMN.as(f -> "prefix_" + f.getName());
*
*
* @deprecated - 3.14.0 - [#10156] - These methods will be removed without
* replacement from a future jOOQ. They offer convenience that
* is unidiomatic for jOOQ's DSL, without offering functionality
* that would not be possible otherwise - yet they add
* complexity in jOOQ's internals.
*/
@Deprecated(forRemoval = true, since = "3.14")
@NotNull
@Support
Field as(Function super Field, ? extends String> aliasFunction);
/**
* {@inheritDoc}
*
* Watch out! This is {@link Object#equals(Object)}, not a jOOQ DSL
* feature!
*/
@Override
boolean equals(Object other);
// ------------------------------------------------------------------------
// SelectField API covariant overrides
// ------------------------------------------------------------------------
@Override
@NotNull
@Support
Field as(String alias);
@Override
@NotNull
@Support
Field as(Name alias);
@Override
@NotNull
@Support
Field as(Field> otherField);
// ------------------------------------------------------------------------
// Ad-hoc converters
// ------------------------------------------------------------------------
@Override
@NotNull
Field convert(Binding binding);
@Override
@NotNull
Field convert(Converter converter);
@Override
@NotNull
Field convert(
Class toType,
Function super T, ? extends U> from,
Function super U, ? extends T> to
);
@Override
@NotNull
Field convertFrom(Class toType, Function super T, ? extends U> from);
@Override
@NotNull
Field convertFrom(Function super T, ? extends U> from);
@Override
@NotNull
Field convertTo(Class toType, Function super U, ? extends T> to);
@Override
@NotNull
Field convertTo(Function super U, ? extends T> to);
// ------------------------------------------------------------------------
// DDL API
// ------------------------------------------------------------------------
/**
* Attach a {@link Comment} to this field, for use in DDL statements, such
* as {@link DSLContext#createTable(Table)}.
*/
@NotNull
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Field comment(String comment);
/**
* Attach a {@link Comment} to this field, for use in DDL statements, such
* as {@link DSLContext#createTable(Table)}.
*/
@NotNull
@Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Field comment(Comment comment);
// ------------------------------------------------------------------------
// Type casts
// ------------------------------------------------------------------------
/**
* Cast this field to the type of another field.
*
* This results in the same as casting this field to
* {@link DataType#getCastTypeName()}
*
* @param The generic type of the cast field
* @param field The field whose type is used for the cast
* @return The cast field
* @see #cast(DataType)
*/
@NotNull
@Support
Field cast(Field field);
/**
* Cast this field to a dialect-specific data type.
*
* @param The generic type of the cast field
* @param type The data type that is used for the cast
* @return The cast field
*/
@NotNull
@Support
Field cast(DataType type);
/**
* Cast this field to another type.
*
* The actual cast may not be accurate as the {@link DataType} has to be
* "guessed" from the jOOQ-configured data types. Use
* {@link #cast(DataType)} for more accurate casts.
*
* NOTE [#15286]: It is strongly recommended to pass only
* {@link Class} references of types supported by jOOQ internally, i.e.
* types from {@link SQLDataType}. If you're using any custom data types by
* means of a {@link Converter} or {@link Binding}, it's better to pass that
* converted {@link DataType} reference explicitly to
* {@link #cast(DataType)}.
*
* @param The generic type of the cast field
* @param type The type that is used for the cast
* @return The cast field
* @see #cast(DataType)
*/
@NotNull
@Support
Field cast(Class type);
// ------------------------------------------------------------------------
// Type coercion
// ------------------------------------------------------------------------
/**
* Coerce this field to the type of another field.
*
* Unlike with casting, coercing doesn't affect the way the database sees a
* Field
's type. This is how coercing affects your SQL:
*
Bind values
* // This binds an int value to a JDBC PreparedStatement
* DSL.val(1).coerce(String.class);
*
* // This binds an int value to a JDBC PreparedStatement
* // and casts it to VARCHAR in SQL
* DSL.val(1).cast(String.class);
*
* Other Field types
* // This fetches a String value for the BOOK.ID field from JDBC
* BOOK.ID.coerce(String.class);
*
* // This fetches a String value for the BOOK.ID field from JDBC
* // after casting it to VARCHAR in the database
* BOOK.ID.cast(String.class);
*
*
* @param The generic type of the coerced field
* @param field The field whose type is used for the coercion
* @return The coerced field
* @see #coerce(DataType)
* @see #cast(Field)
*/
@NotNull
@Support
Field coerce(Field field);
/**
* Coerce this field to a dialect-specific data type.
*
* Unlike with casting, coercing doesn't affect the way the database sees a
* Field
's type. This is how coercing affects your SQL:
*
Bind values
* // This binds an int value to a JDBC PreparedStatement
* DSL.val(1).coerce(String.class);
*
* // This binds an int value to a JDBC PreparedStatement
* // and casts it to VARCHAR in SQL
* DSL.val(1).cast(String.class);
*
* Other Field types
* // This fetches a String value for the BOOK.ID field from JDBC
* BOOK.ID.coerce(String.class);
*
* // This fetches a String value for the BOOK.ID field from JDBC
* // after casting it to VARCHAR in the database
* BOOK.ID.cast(String.class);
*
*
* @param The generic type of the coerced field
* @param type The data type that is used for the coercion
* @return The coerced field
* @see #cast(DataType)
*/
@NotNull
@Support
Field coerce(DataType type);
/**
* Coerce this field to another type.
*
* Unlike with casting, coercing doesn't affect the way the database sees a
* Field
's type. This is how coercing affects your SQL:
*
Bind values
* // This binds an int value to a JDBC PreparedStatement
* DSL.val(1).coerce(String.class);
*
* // This binds an int value to a JDBC PreparedStatement
* // and casts it to VARCHAR in SQL
* DSL.val(1).cast(String.class);
*
* Other Field types
* // This fetches a String value for the BOOK.ID field from JDBC
* BOOK.ID.coerce(String.class);
*
* // This fetches a String value for the BOOK.ID field from JDBC
* // after casting it to VARCHAR in the database
* BOOK.ID.cast(String.class);
*
*
* NOTE [#15286]: It is strongly recommended to pass only
* {@link Class} references of types supported by jOOQ internally, i.e.
* types from {@link SQLDataType}. If you're using any custom data types by
* means of a {@link Converter} or {@link Binding}, it's better to pass that
* converted {@link DataType} reference explicitly to
* {@link #coerce(DataType)}.
*
* @param The generic type of the coerced field
* @param type The type that is used for the coercion
* @return The coerced field
* @see #coerce(DataType)
* @see #cast(Class)
*/
@NotNull
@Support
Field coerce(Class type);
// ------------------------------------------------------------------------
// Conversion of field into a sort field
// ------------------------------------------------------------------------
/**
* Create an ascending sort field from this field.
*
* This is the same as calling {@link #sort(SortOrder)} with
* {@link SortOrder#ASC}
*
* @return This field as an ascending sort field
*/
@NotNull
@Support
SortField asc();
/**
* Create a descending sort field from this field.
*
* This is the same as calling {@link #sort(SortOrder)} with
* {@link SortOrder#DESC}
*
* @return This field as a descending sort field
*/
@NotNull
@Support
SortField desc();
/**
* Create a default sorted (implicit ASC
) from this field.
*
* This is the same as calling {@link #sort(SortOrder)} with
* {@link SortOrder#DEFAULT}
*
* @return This field as a default sorted sort field
*/
@NotNull
@Support
SortField sortDefault();
/**
* Create an ascending/descending sort field from this field.
*
* @param order The sort order
* @return This field as an ascending/descending sort field.
*/
@NotNull
@Support
SortField sort(SortOrder order);
/**
* Create an indirected sort field.
*
* Create a sort field of the form
* CASE [this] WHEN [sortList.get(0)] THEN 0
* WHEN [sortList.get(1)] THEN 1
* ...
* WHEN [sortList.get(n)] THEN n
* ELSE null
* END ASC
*
*
* Note: You can use this in combination with {@link SortField#nullsFirst()}
* or {@link SortField#nullsLast()} to specify whether the default should
* have highest or lowest priority.
*
* @param sortList The list containing sort value preferences
* @return The sort field
*/
@NotNull
@Support
SortField sortAsc(Collection sortList);
/**
* Create an indirected sort field.
*
* Create a sort field of the form
* CASE [this] WHEN [sortList[0]] THEN 0
* WHEN [sortList[1]] THEN 1
* ...
* WHEN [sortList[n]] THEN n
* ELSE null
* END ASC
*
*
* Note: You can use this in combination with {@link SortField#nullsFirst()}
* or {@link SortField#nullsLast()} to specify whether the default should
* have highest or lowest priority.
*
* @param sortList The list containing sort value preferences
* @return The sort field
*/
@NotNull
@Support
SortField sortAsc(T... sortList);
/**
* Create an indirected sort field.
*
* Create a sort field of the form
* CASE [this] WHEN [sortList.get(0)] THEN 0
* WHEN [sortList.get(1)] THEN 1
* ...
* WHEN [sortList.get(n)] THEN n
* ELSE null
* END DESC
*
*
* Note: You can use this in combination with {@link SortField#nullsFirst()}
* or {@link SortField#nullsLast()} to specify whether the default should
* have highest or lowest priority.
*
* @param sortList The list containing sort value preferences
* @return The sort field
*/
@NotNull
@Support
SortField sortDesc(Collection sortList);
/**
* Create an indirected sort field.
*
* Create a sort field of the form
* CASE [this] WHEN [sortList[0]] THEN 0
* WHEN [sortList[1]] THEN 1
* ...
* WHEN [sortList[n]] THEN n
* ELSE null
* END DESC
*
*
* Note: You can use this in combination with {@link SortField#nullsFirst()}
* or {@link SortField#nullsLast()} to specify whether the default should
* have highest or lowest priority.
*
* @param sortList The list containing sort value preferences
* @return The sort field
*/
@NotNull
@Support
SortField sortDesc(T... sortList);
/**
* Create an indirected sort field.
*
* Create a sort field of the form (in pseudo code)
* CASE [this] WHEN [sortMap.key(0)] THEN sortMap.value(0)
* WHEN [sortMap.key(1)] THEN sortMap.value(1)
* ...
* WHEN [sortMap.key(n)] THEN sortMap.value(n)
* ELSE null
* END DESC
*
*
* Note: You can use this in combination with {@link SortField#nullsFirst()}
* or {@link SortField#nullsLast()} to specify whether the default should
* have highest or lowest priority.
*
* @param sortMap The list containing sort value preferences
* @return The sort field
*/
@NotNull
@Support
SortField sort(Map sortMap);
/**
* Convenience method for {@link #sortDefault()} and then
* {@link SortField#nullsFirst()}.
*/
@NotNull
@Support
SortField nullsFirst();
/**
* Convenience method for {@link #sortDefault()} and then
* {@link SortField#nullsLast()}.
*/
@NotNull
@Support
SortField nullsLast();
// -------------------------------------------------------------------------
// Generic predicates
// -------------------------------------------------------------------------
/**
* The EQ
operator.
*/
@NotNull
@Support
Condition eq(T arg2);
/**
* The EQ
operator.
*/
@NotNull
@Support
Condition eq(Select extends Record1> arg2);
/**
* The EQ
operator.
*/
@NotNull
@Support
Condition eq(Field arg2);
/**
* The EQ
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition eq(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The EQUAL
operator, an alias for the EQ
operator.
*/
@NotNull
@Support
Condition equal(T arg2);
/**
* The EQUAL
operator, an alias for the EQ
operator.
*/
@NotNull
@Support
Condition equal(Select extends Record1> arg2);
/**
* The EQUAL
operator, an alias for the EQ
operator.
*/
@NotNull
@Support
Condition equal(Field arg2);
/**
* The EQUAL
operator, an alias for the EQ
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition equal(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The GE
operator.
*/
@NotNull
@Support
Condition ge(T arg2);
/**
* The GE
operator.
*/
@NotNull
@Support
Condition ge(Select extends Record1> arg2);
/**
* The GE
operator.
*/
@NotNull
@Support
Condition ge(Field arg2);
/**
* The GE
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition ge(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The GREATER_OR_EQUAL
operator, an alias for the GE
operator.
*/
@NotNull
@Support
Condition greaterOrEqual(T arg2);
/**
* The GREATER_OR_EQUAL
operator, an alias for the GE
operator.
*/
@NotNull
@Support
Condition greaterOrEqual(Select extends Record1> arg2);
/**
* The GREATER_OR_EQUAL
operator, an alias for the GE
operator.
*/
@NotNull
@Support
Condition greaterOrEqual(Field arg2);
/**
* The GREATER_OR_EQUAL
operator, an alias for the GE
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition greaterOrEqual(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The GREATER_THAN
operator, an alias for the GT
operator.
*/
@NotNull
@Support
Condition greaterThan(T arg2);
/**
* The GREATER_THAN
operator, an alias for the GT
operator.
*/
@NotNull
@Support
Condition greaterThan(Select extends Record1> arg2);
/**
* The GREATER_THAN
operator, an alias for the GT
operator.
*/
@NotNull
@Support
Condition greaterThan(Field arg2);
/**
* The GREATER_THAN
operator, an alias for the GT
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition greaterThan(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The GT
operator.
*/
@NotNull
@Support
Condition gt(T arg2);
/**
* The GT
operator.
*/
@NotNull
@Support
Condition gt(Select extends Record1> arg2);
/**
* The GT
operator.
*/
@NotNull
@Support
Condition gt(Field arg2);
/**
* The GT
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition gt(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The IN
operator.
*
* The subquery must return exactly one field. This is not checked
* by jOOQ and will result in syntax errors in the database, if not used
* correctly.
*/
@NotNull
@Support
Condition in(Select extends Record1> arg2);
/**
* The IS_DISTINCT_FROM
operator.
*
* The DISTINCT predicate allows for creating NULL safe comparisons where the two operands
* are tested for non-equality
*/
@NotNull
@Support
Condition isDistinctFrom(T arg2);
/**
* The IS_DISTINCT_FROM
operator.
*
* The DISTINCT predicate allows for creating NULL safe comparisons where the two operands
* are tested for non-equality
*/
@NotNull
@Support
Condition isDistinctFrom(Select extends Record1> arg2);
/**
* The IS_DISTINCT_FROM
operator.
*
* The DISTINCT predicate allows for creating NULL safe comparisons where the two operands
* are tested for non-equality
*/
@NotNull
@Support
Condition isDistinctFrom(Field arg2);
/**
* The IS_NULL
operator.
*/
@NotNull
@Support
Condition isNull();
/**
* The IS_NOT_DISTINCT_FROM
operator.
*
* The NOT DISTINCT predicate allows for creating NULL safe comparisons where the two
* operands are tested for equality
*/
@NotNull
@Support
Condition isNotDistinctFrom(T arg2);
/**
* The IS_NOT_DISTINCT_FROM
operator.
*
* The NOT DISTINCT predicate allows for creating NULL safe comparisons where the two
* operands are tested for equality
*/
@NotNull
@Support
Condition isNotDistinctFrom(Select extends Record1> arg2);
/**
* The IS_NOT_DISTINCT_FROM
operator.
*
* The NOT DISTINCT predicate allows for creating NULL safe comparisons where the two
* operands are tested for equality
*/
@NotNull
@Support
Condition isNotDistinctFrom(Field arg2);
/**
* The IS_NOT_NULL
operator.
*/
@NotNull
@Support
Condition isNotNull();
/**
* The LE
operator.
*/
@NotNull
@Support
Condition le(T arg2);
/**
* The LE
operator.
*/
@NotNull
@Support
Condition le(Select extends Record1> arg2);
/**
* The LE
operator.
*/
@NotNull
@Support
Condition le(Field arg2);
/**
* The LE
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition le(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The LESS_OR_EQUAL
operator, an alias for the LE
operator.
*/
@NotNull
@Support
Condition lessOrEqual(T arg2);
/**
* The LESS_OR_EQUAL
operator, an alias for the LE
operator.
*/
@NotNull
@Support
Condition lessOrEqual(Select extends Record1> arg2);
/**
* The LESS_OR_EQUAL
operator, an alias for the LE
operator.
*/
@NotNull
@Support
Condition lessOrEqual(Field arg2);
/**
* The LESS_OR_EQUAL
operator, an alias for the LE
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition lessOrEqual(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The LESS_THAN
operator, an alias for the LT
operator.
*/
@NotNull
@Support
Condition lessThan(T arg2);
/**
* The LESS_THAN
operator, an alias for the LT
operator.
*/
@NotNull
@Support
Condition lessThan(Select extends Record1> arg2);
/**
* The LESS_THAN
operator, an alias for the LT
operator.
*/
@NotNull
@Support
Condition lessThan(Field arg2);
/**
* The LESS_THAN
operator, an alias for the LT
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition lessThan(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The LIKE
operator.
*
* @param pattern is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
LikeEscapeStep like(@Stringly.Param String pattern);
/**
* The LIKE
operator.
*/
@NotNull
@Support
LikeEscapeStep like(Field pattern);
/**
* The LIKE
operator.
*/
@NotNull
@Support
LikeEscapeStep like(org.jooq.QuantifiedSelect extends Record1> pattern);
/**
* The LIKE_IGNORE_CASE
operator.
*
* Create a condition to case-insensitively pattern-check this field against
* a value.
*
* This translates to this ilike value
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) like lower(value)
in all other dialects.
*
* @param pattern is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
LikeEscapeStep likeIgnoreCase(@Stringly.Param String pattern);
/**
* The LIKE_IGNORE_CASE
operator.
*
* Create a condition to case-insensitively pattern-check this field against
* a value.
*
* This translates to this ilike value
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) like lower(value)
in all other dialects.
*/
@NotNull
@Support
LikeEscapeStep likeIgnoreCase(Field pattern);
/**
* The LT
operator.
*/
@NotNull
@Support
Condition lt(T arg2);
/**
* The LT
operator.
*/
@NotNull
@Support
Condition lt(Select extends Record1> arg2);
/**
* The LT
operator.
*/
@NotNull
@Support
Condition lt(Field arg2);
/**
* The LT
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition lt(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The NE
operator.
*/
@NotNull
@Support
Condition ne(T arg2);
/**
* The NE
operator.
*/
@NotNull
@Support
Condition ne(Select extends Record1> arg2);
/**
* The NE
operator.
*/
@NotNull
@Support
Condition ne(Field arg2);
/**
* The NE
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition ne(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The NOT_EQUAL
operator, an alias for the NE
operator.
*/
@NotNull
@Support
Condition notEqual(T arg2);
/**
* The NOT_EQUAL
operator, an alias for the NE
operator.
*/
@NotNull
@Support
Condition notEqual(Select extends Record1> arg2);
/**
* The NOT_EQUAL
operator, an alias for the NE
operator.
*/
@NotNull
@Support
Condition notEqual(Field arg2);
/**
* The NOT_EQUAL
operator, an alias for the NE
operator.
*/
@NotNull
@Support({ CUBRID, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, YUGABYTEDB })
Condition notEqual(org.jooq.QuantifiedSelect extends Record1> arg2);
/**
* The NOT_IN
operator.
*
* The subquery must return exactly one field. This is not checked
* by jOOQ and will result in syntax errors in the database, if not used
* correctly.
*
* If any of the passed values is NULL
, then the
* condition will be NULL
(or false
, depending on
* the dialect) as well. This is standard SQL behaviour.
*/
@NotNull
@Support
Condition notIn(Select extends Record1> arg2);
/**
* The NOT_LIKE
operator.
*
* @param pattern is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
LikeEscapeStep notLike(@Stringly.Param String pattern);
/**
* The NOT_LIKE
operator.
*/
@NotNull
@Support
LikeEscapeStep notLike(Field pattern);
/**
* The NOT_LIKE
operator.
*/
@NotNull
@Support
LikeEscapeStep notLike(org.jooq.QuantifiedSelect extends Record1> pattern);
/**
* The NOT_LIKE_IGNORE_CASE
operator.
*
* Create a condition to case-insensitively pattern-check this field against
* a value.
*
* This translates to this not ilike value
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) not like lower(value)
in all other dialects.
*
* @param pattern is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
LikeEscapeStep notLikeIgnoreCase(@Stringly.Param String pattern);
/**
* The NOT_LIKE_IGNORE_CASE
operator.
*
* Create a condition to case-insensitively pattern-check this field against
* a value.
*
* This translates to this not ilike value
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) not like lower(value)
in all other dialects.
*/
@NotNull
@Support
LikeEscapeStep notLikeIgnoreCase(Field pattern);
/**
* The NOT_SIMILAR_TO
operator.
*
* @param pattern is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, IGNITE, POSTGRES, YUGABYTEDB })
LikeEscapeStep notSimilarTo(@Stringly.Param String pattern);
/**
* The NOT_SIMILAR_TO
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, IGNITE, POSTGRES, YUGABYTEDB })
LikeEscapeStep notSimilarTo(Field pattern);
/**
* The NOT_SIMILAR_TO
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, IGNITE, POSTGRES, YUGABYTEDB })
LikeEscapeStep notSimilarTo(org.jooq.QuantifiedSelect extends Record1> pattern);
/**
* The SIMILAR_TO
operator.
*
* @param pattern is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, IGNITE, POSTGRES, YUGABYTEDB })
LikeEscapeStep similarTo(@Stringly.Param String pattern);
/**
* The SIMILAR_TO
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, IGNITE, POSTGRES, YUGABYTEDB })
LikeEscapeStep similarTo(Field pattern);
/**
* The SIMILAR_TO
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, IGNITE, POSTGRES, YUGABYTEDB })
LikeEscapeStep similarTo(org.jooq.QuantifiedSelect extends Record1> pattern);
// -------------------------------------------------------------------------
// XML predicates
// -------------------------------------------------------------------------
/**
* The IS_DOCUMENT
operator.
*
* Create a condition to check if this field contains XML data.
*/
@NotNull
@Support({ POSTGRES })
Condition isDocument();
/**
* The IS_NOT_DOCUMENT
operator.
*
* Create a condition to check if this field does not contain XML data.
*/
@NotNull
@Support({ POSTGRES })
Condition isNotDocument();
// -------------------------------------------------------------------------
// JSON predicates
// -------------------------------------------------------------------------
/**
* The IS_JSON
operator.
*
* Create a condition to check if this field contains JSON data.
*/
@NotNull
@Support({ DUCKDB, MARIADB, MYSQL })
Condition isJson();
/**
* The IS_NOT_JSON
operator.
*
* Create a condition to check if this field does not contain JSON data.
*/
@NotNull
@Support({ DUCKDB, MARIADB, MYSQL })
Condition isNotJson();
// -------------------------------------------------------------------------
// Numeric functions
// -------------------------------------------------------------------------
/**
* The BIT_AND
operator.
*
* @param arg2 is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitAnd(T arg2);
/**
* The BIT_AND
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitAnd(Field arg2);
/**
* The BIT_NAND
operator.
*
* @param arg2 is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitNand(T arg2);
/**
* The BIT_NAND
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitNand(Field arg2);
/**
* The BIT_NOR
operator.
*
* @param arg2 is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitNor(T arg2);
/**
* The BIT_NOR
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitNor(Field arg2);
/**
* The BIT_NOT
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitNot();
/**
* The BIT_OR
operator.
*
* @param arg2 is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitOr(T arg2);
/**
* The BIT_OR
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitOr(Field arg2);
/**
* The BIT_XNOR
operator.
*
* @param arg2 is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitXNor(T arg2);
/**
* The BIT_XNOR
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitXNor(Field arg2);
/**
* The BIT_XOR
operator.
*
* @param arg2 is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitXor(T arg2);
/**
* The BIT_XOR
operator.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field bitXor(Field arg2);
/**
* The MOD
operator.
*
* @param divisor is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Field mod(Number divisor);
/**
* The MOD
operator.
*/
@NotNull
@Support
Field mod(Field extends Number> divisor);
/**
* The MODULO
operator, an alias for the MOD
operator.
*
* @param divisor is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Field modulo(Number divisor);
/**
* The MODULO
operator, an alias for the MOD
operator.
*/
@NotNull
@Support
Field modulo(Field extends Number> divisor);
/**
* The REM
operator, an alias for the MOD
operator.
*
* @param divisor is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Field rem(Number divisor);
/**
* The REM
operator, an alias for the MOD
operator.
*/
@NotNull
@Support
Field rem(Field extends Number> divisor);
/**
* The POWER
operator.
*
* @param exponent is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Field power(Number exponent);
/**
* The POWER
operator.
*/
@NotNull
@Support
Field power(Field extends Number> exponent);
/**
* The POW
operator, an alias for the POWER
operator.
*
* @param exponent is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Field pow(Number exponent);
/**
* The POW
operator, an alias for the POWER
operator.
*/
@NotNull
@Support
Field pow(Field extends Number> exponent);
/**
* The SHL
operator.
*
* Left shift all bits in a number
*
* @param value The number whose bits to shift left.
* @param count The number of bits to shift.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field shl(Number count);
/**
* The SHL
operator.
*
* Left shift all bits in a number
*
* @param value The number whose bits to shift left.
* @param count The number of bits to shift.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field shl(Field extends Number> count);
/**
* The SHR
operator.
*
* Right shift all bits in a number
*
* @param value The number whose bits to shift right
* @param count The number of bits to shift.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field shr(Number count);
/**
* The SHR
operator.
*
* Right shift all bits in a number
*
* @param value The number whose bits to shift right
* @param count The number of bits to shift.
*/
@NotNull
@Support({ CUBRID, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, TRINO, YUGABYTEDB })
Field shr(Field extends Number> count);
// -------------------------------------------------------------------------
// String functions
// -------------------------------------------------------------------------
/**
* The CONTAINS
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: this like ('%' || escape(value, '\') || '%') escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).contains(13)
*
* If you're using {@link SQLDialect#POSTGRES}, then you can use this method
* also to express the "ARRAY contains" operator. For example:
* // Use this expression
* val(new Integer[] { 1, 2, 3 }).contains(new Integer[] { 1, 2 })
*
* // ... to render this SQL
* ARRAY[1, 2, 3] @> ARRAY[1, 2]
*
*
* Note, this does not correspond to the Oracle Text CONTAINS()
* function. Refer to {@link OracleDSL#contains(Field, String)} instead.
*
* @param content is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Condition contains(T content);
/**
* The CONTAINS
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: this like ('%' || escape(value, '\') || '%') escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).contains(13)
*
* If you're using {@link SQLDialect#POSTGRES}, then you can use this method
* also to express the "ARRAY contains" operator. For example:
* // Use this expression
* val(new Integer[] { 1, 2, 3 }).contains(new Integer[] { 1, 2 })
*
* // ... to render this SQL
* ARRAY[1, 2, 3] @> ARRAY[1, 2]
*
*
* Note, this does not correspond to the Oracle Text CONTAINS()
* function. Refer to {@link OracleDSL#contains(Field, String)} instead.
*/
@NotNull
@Support
Condition contains(Field content);
/**
* The CONTAINS_IGNORE_CASE
operator.
*
* Convenience method for {@link Field#likeIgnoreCase(String, char)} including
* proper adding of wildcards and escaping.
*
* This translates to
* this ilike ('%' || escape(value, '\') || '%') escape '\'
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) like lower(('%' || escape(value, '\') || '%') escape '\')
* in all other dialects.
*
* @param content is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Condition containsIgnoreCase(T content);
/**
* The CONTAINS_IGNORE_CASE
operator.
*
* Convenience method for {@link Field#likeIgnoreCase(String, char)} including
* proper adding of wildcards and escaping.
*
* This translates to
* this ilike ('%' || escape(value, '\') || '%') escape '\'
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) like lower(('%' || escape(value, '\') || '%') escape '\')
* in all other dialects.
*/
@NotNull
@Support
Condition containsIgnoreCase(Field content);
/**
* The ENDS_WITH
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: this like ('%' || escape(value, '\')) escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).endsWith(33)
*
* @param suffix is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Condition endsWith(T suffix);
/**
* The ENDS_WITH
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: this like ('%' || escape(value, '\')) escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).endsWith(33)
*/
@NotNull
@Support
Condition endsWith(Field suffix);
/**
* The ENDS_WITH_IGNORE_CASE
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: lower(this) like ('%' || lower(escape(value, '\'))) escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).endsWithIgnoreCase(33)
*
* @param suffix is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Condition endsWithIgnoreCase(T suffix);
/**
* The ENDS_WITH_IGNORE_CASE
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: lower(this) like ('%' || lower(escape(value, '\'))) escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).endsWithIgnoreCase(33)
*/
@NotNull
@Support
Condition endsWithIgnoreCase(Field suffix);
/**
* The STARTS_WITH
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: this like (escape(value, '\') || '%') escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).startsWith(11)
*
* @param prefix is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Condition startsWith(T prefix);
/**
* The STARTS_WITH
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: this like (escape(value, '\') || '%') escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).startsWith(11)
*/
@NotNull
@Support
Condition startsWith(Field prefix);
/**
* The STARTS_WITH_IGNORE_CASE
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: lower(this) like (lower(escape(value, '\')) || '%') escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).startsWithIgnoreCase(11)
*
* @param prefix is wrapped as {@link DSL#val(Object)}.
*/
@NotNull
@Support
Condition startsWithIgnoreCase(T prefix);
/**
* The STARTS_WITH_IGNORE_CASE
operator.
*
* Convenience method for {@link Field#like(String, char)} including proper
* adding of wildcards and escaping.
*
* SQL: lower(this) like (lower(escape(value, '\')) || '%') escape '\'
*
* Note: This also works with numbers, for instance
* val(1133).startsWithIgnoreCase(11)
*/
@NotNull
@Support
Condition startsWithIgnoreCase(Field prefix);
// ------------------------------------------------------------------------
// Arithmetic operations
// ------------------------------------------------------------------------
/**
* Negate this field to get its negative value.
*
* This renders the same on all dialects:
-[this]
*/
@NotNull
@Support
Field neg();
/**
* Negate this field to get its negative value.
*
* This is an alias for {@link #neg()}, which can be recognised by the
* Kotlin language for operator overloading.
*/
@NotNull
@Support
Field unaryMinus();
/**
* Get this field as its positive value (no effect on SQL).
*
* This can be recognised by the Kotlin language for operator overloading.
*/
@NotNull
@Support
Field unaryPlus();
/**
* An arithmetic expression adding this to value.
*
* @see #add(Field)
*/
@NotNull
@Support
Field add(Number value);
/**
* An arithmetic expression to add value to this.
*
* The behaviour of this operation is as follows:
*
*
* Operand 1
* Operand 2
* Result Type
*
*
* Numeric
* Numeric
* Numeric
*
*
* Date / Time
* Numeric
* Date / Time
*
*
* Date / Time
* Interval
* Date / Time
*
*
* Interval
* Interval
* Interval
*
*
*/
@NotNull
@Support
Field add(Field> value);
/**
* An alias for {@link #add(Number)}.
*
* @see #add(Number)
*/
@NotNull
@Support
Field plus(Number value);
/**
* An alias for {@link #add(Field)}.
*
* @see #add(Field)
*/
@NotNull
@Support
Field plus(Field> value);
/**
* An arithmetic expression subtracting value from this.
*
* @see #sub(Field)
*/
@NotNull
@Support
Field sub(Number value);
/**
* An arithmetic expression subtracting value from this.
*
*
*
* Operand 1
* Operand 2
* Result Type
*
*
* Numeric
* Numeric
* Numeric
*
*
* Date / Time
* Numeric
* Date / Time
*
*
* Date / Time
* Interval
* Date / Time
*
*
* Interval
* Interval
* Interval
*
*
*
* In order to subtract one date time field from another, use any of these
* methods:
*
* - {@link DSL#dateDiff(Field, Field)}
* - {@link DSL#timestampDiff(Field, Field)}
*
*/
@NotNull
@Support
Field sub(Field> value);
/**
* An alias for {@link #sub(Number)}.
*
* @see #sub(Number)
*/
@NotNull
@Support
Field subtract(Number value);
/**
* An alias for {@link #sub(Field)}.
*
* @see #sub(Field)
*/
@NotNull
@Support
Field subtract(Field> value);
/**
* An alias for {@link #sub(Number)}.
*
* @see #sub(Number)
*/
@NotNull
@Support
Field minus(Number value);
/**
* An alias for {@link #sub(Field)}.
*
* @see #sub(Field)
*/
@NotNull
@Support
Field minus(Field> value);
/**
* An arithmetic expression multiplying this with value.
*
*
* - If this is a numeric field, then the result is a number of the same
* type as this field.
* - If this is an
INTERVAL
field, then the result is also an
* INTERVAL
field (see {@link Interval})
*
*/
@NotNull
@Support
Field mul(Number value);
/**
* An arithmetic expression multiplying this with value.
*
*
* - If this is a numeric field, then the result is a number of the same
* type as this field.
* - If this is an
INTERVAL
field, then the result is also an
* INTERVAL
field (see {@link Interval})
*
*/
@NotNull
@Support
Field mul(Field extends Number> value);
/**
* An alias for {@link #mul(Number)}.
*
* @see #mul(Number)
*/
@NotNull
@Support
Field multiply(Number value);
/**
* An alias for {@link #mul(Field)}.
*
* @see #mul(Field)
*/
@NotNull
@Support
Field multiply(Field extends Number> value);
/**
* An alias for {@link #mul(Number)}.
*
* @see #mul(Number)
*/
@NotNull
@Support
Field times(Number value);
/**
* An alias for {@link #mul(Field)}.
*
* @see #mul(Field)
*/
@NotNull
@Support
Field times(Field extends Number> value);
/**
* An arithmetic expression dividing this by value.
*
*
* - If this is a numeric field, then the result is a number of the same
* type as this field.
* - If this is an
INTERVAL
field, then the result is also an
* INTERVAL
field (see {@link Interval})
*
*/
@NotNull
@Support
Field div(Number value);
/**
* An arithmetic expression dividing this by value.
*
*
* - If this is a numeric field, then the result is a number of the same
* type as this field.
* - If this is an
INTERVAL
field, then the result is also an
* INTERVAL
field (see {@link Interval})
*
*/
@NotNull
@Support
Field div(Field extends Number> value);
/**
* An alias for {@link #div(Number)}.
*
* @see #div(Number)
*/
@NotNull
@Support
Field divide(Number value);
/**
* An alias for {@link #div(Field)}.
*
* @see #div(Field)
*/
@NotNull
@Support
Field divide(Field extends Number> value);
// ------------------------------------------------------------------------
// LIKE_REGEX predicates
// ------------------------------------------------------------------------
/**
* Create a condition to regex-pattern-check this field against a pattern.
*
* The SQL:2008 standard specifies a <regex like predicate>
* of the following form:
* <regex like predicate> ::=
* <row value predicand> <regex like predicate part 2>
*
* <regex like predicate part 2> ::=
* [ NOT ] LIKE_REGEX <XQuery pattern> [ FLAG <XQuery option flag> ]
*
*
* This particular LIKE_REGEX
operator comes in several
* flavours for various databases. jOOQ supports regular expressions as
* follows:
*
*
* SQL dialect
* SQL syntax
* Pattern syntax
* Documentation
*
*
* {@link SQLDialect#ASE}
* -
* -
* -
*
*
* {@link SQLDialect#DB2}
* -
* -
* -
*
*
* {@link SQLDialect#DERBY}
* -
* -
* -
*
*
* {@link SQLDialect#H2}
* [search] REGEXP [pattern]
* Java
* https
* ://www.h2database.com/html/grammar.html#condition_right_hand_side
*
*
* {@link SQLDialect#HSQLDB}
* REGEXP_MATCHES([search], [pattern])
* Java
* http://hsqldb.org/doc/guide/builtinfunctions-chapt.html#N13577
*
*
* {@link SQLDialect#INGRES}
* -
* -
* -
*
*
* {@link SQLDialect#MYSQL}
* [search] REGEXP [pattern]
* POSIX
* http://dev
* .mysql.com/doc/refman/5.6/en/regexp.html
*
*
* {@link SQLDialect#ORACLE}
* REGEXP_LIKE([search], [pattern])
* POSIX
* http://docs.oracle.com/cd/E14072_01/server.112/e10592/conditions007.htm#
* sthref1994
*
*
* {@link SQLDialect#POSTGRES}
* [search] ~ [pattern]
* POSIX
* http://www.postgresql.org/docs/9.1/static/functions-matching.html#
* FUNCTIONS-POSIX-REGEXP
*
*
* {@link SQLDialect#SQLITE}
* [search] REGEXP [pattern]
* ? This module has to be loaded explicitly
* http://www.sqlite.org/
* lang_expr.html
*
*
* {@link SQLDialect#SQLSERVER}
* -
* -
* -
*
*
* {@link SQLDialect#SYBASE}
* [search] REGEXP [pattern]
* Perl
* http://infocenter.sybase.com/help/topic/com.sybase.help.sqlanywhere.12.0
* .1/dbreference/like-regexp-similarto.html
*
*
*
* @see #likeRegex(String)
*/
@NotNull
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition likeRegex(String pattern);
/**
* Create a condition to regex-pattern-check this field against a pattern.
*
* See {@link #likeRegex(String)} for more details
*
* @see #likeRegex(String)
*/
@NotNull
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition likeRegex(Field pattern);
/**
* Create a condition to regex-pattern-check this field against a pattern.
*
* See {@link #likeRegex(String)} for more details
*
* @see #likeRegex(String)
*/
@NotNull
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notLikeRegex(String pattern);
/**
* Create a condition to regex-pattern-check this field against a pattern.
*
* See {@link #likeRegex(String)} for more details
*
* @see #likeRegex(Field)
*/
@NotNull
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notLikeRegex(Field pattern);
// ------------------------------------------------------------------------
// SIMILAR TO predicates
// ------------------------------------------------------------------------
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this similar to value escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ FIREBIRD, POSTGRES, YUGABYTEDB })
Condition similarTo(Field value, char escape);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this similar to value escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ FIREBIRD, POSTGRES, YUGABYTEDB })
Condition similarTo(String value, char escape);
/**
* Create a condition to pattern-check this field against a field.
*
* SQL: this not similar to field escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ FIREBIRD, POSTGRES, YUGABYTEDB })
Condition notSimilarTo(Field field, char escape);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this not similar to value escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ FIREBIRD, POSTGRES, YUGABYTEDB })
Condition notSimilarTo(String value, char escape);
// ------------------------------------------------------------------------
// LIKE predicates
// ------------------------------------------------------------------------
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this like value escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition like(Field value, char escape);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this like value escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition like(String value, char escape);
/**
* Create a condition to case-insensitively pattern-check this field against
* a field.
*
* This translates to this ilike field
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) like lower(field)
in all other dialects.
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition likeIgnoreCase(Field field, char escape);
/**
* Create a condition to case-insensitively pattern-check this field against
* a value.
*
* This translates to this ilike value
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) like lower(value)
in all other dialects.
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition likeIgnoreCase(String value, char escape);
/**
* Create a condition to pattern-check this field against a field.
*
* SQL: this not like field escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notLike(Field field, char escape);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this not like value escape 'e'
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notLike(String value, char escape);
/**
* Create a condition to case-insensitively pattern-check this field against
* a field.
*
* This translates to this not ilike field
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) not like lower(field)
in all other dialects.
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notLikeIgnoreCase(Field field, char escape);
/**
* Create a condition to case-insensitively pattern-check this field against
* a value.
*
* This translates to this not ilike value
in
* {@link SQLDialect#POSTGRES}, or to
* lower(this) not like lower(value)
in all other dialects.
*
* @see LikeEscapeStep#escape(char)
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notLikeIgnoreCase(String value, char escape);
/**
* Inverse of {@link #contains(Object)}.
*/
@NotNull
@Support
Condition notContains(T value);
/**
* Inverse of {@link #contains(Field)}.
*/
@NotNull
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notContains(Field value);
/**
* Inverse of {@link #containsIgnoreCase(Object)}
*/
@NotNull
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notContainsIgnoreCase(T value);
/**
* Inverse of {@link #containsIgnoreCase(Field)}
*/
@NotNull
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, IGNITE, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTEDB })
Condition notContainsIgnoreCase(Field value);
// ------------------------------------------------------------------------
// IN predicates
// ------------------------------------------------------------------------
/**
* Create a condition to check this field against several values.
*
* SQL: this in (values…)
*
* Note that generating dynamic SQL with arbitrary-length IN
* predicates can cause cursor cache contention in some databases that use
* unique SQL strings as a statement identifier (e.g.
* {@link SQLDialect#ORACLE}). In order to prevent such problems, you could
* use {@link Settings#isInListPadding()} to produce less distinct SQL
* strings (see also
* [#5600]), or you
* could avoid IN
lists, and replace them with:
*
* IN
predicates on temporary tables
* IN
predicates on unnested array bind variables
*
*/
@NotNull
@Support
Condition in(Collection> values);
/**
* Create a condition to check this field against several values from a
* previous query.
*
* SQL: this in (values…)
*
* Note that generating dynamic SQL with arbitrary-length IN
* predicates can cause cursor cache contention in some databases that use
* unique SQL strings as a statement identifier (e.g.
* {@link SQLDialect#ORACLE}). In order to prevent such problems, you could
* use {@link Settings#isInListPadding()} to produce less distinct SQL
* strings (see also
* [#5600]), or you
* could avoid IN
lists, and replace them with:
*
* IN
predicates on temporary tables
* IN
predicates on unnested array bind variables
*
*/
@NotNull
@Support
Condition in(Result extends Record1> result);
/**
* Create a condition to check this field against several values.
*
* SQL: this in (values…)
*
* Note that generating dynamic SQL with arbitrary-length IN
* predicates can cause cursor cache contention in some databases that use
* unique SQL strings as a statement identifier (e.g.
* {@link SQLDialect#ORACLE}). In order to prevent such problems, you could
* use {@link Settings#isInListPadding()} to produce less distinct SQL
* strings (see also
* [#5600]), or you
* could avoid IN
lists, and replace them with:
*
* IN
predicates on temporary tables
* IN
predicates on unnested array bind variables
*
*/
@NotNull
@Support
Condition in(T... values);
/**
* Create a condition to check this field against several values.
*
* SQL: this in (values…)
*/
@NotNull
@Support
Condition in(Field>... values);
/**
* Create a condition to check this field against several values.
*
* Note that if any of the passed values is NULL
, then the
* condition will be NULL
(or false
, depending on
* the dialect) as well. This is standard SQL behaviour.
*
* SQL: this not in (values…)
*
* Note that generating dynamic SQL with arbitrary-length
* NOT IN
predicates can cause cursor cache contention in some
* databases that use unique SQL strings as a statement identifier (e.g.
* {@link SQLDialect#ORACLE}). In order to prevent such problems, you could
* use {@link Settings#isInListPadding()} to produce less distinct SQL
* strings (see also
* [#5600]), or you
* could avoid IN
lists, and replace them with:
*
* NOT IN
predicates on temporary tables
* NOT IN
predicates on unnested array bind variables
*
*/
@NotNull
@Support
Condition notIn(Collection> values);
/**
* Create a condition to check this field against several values from a
* previous query.
*
* Note that if any of the passed values is NULL
, then the
* condition will be NULL
(or false
, depending on
* the dialect) as well. This is standard SQL behaviour.
*
* SQL: this in (values…)
*
* Note that generating dynamic SQL with arbitrary-length
* NOT IN
predicates can cause cursor cache contention in some
* databases that use unique SQL strings as a statement identifier (e.g.
* {@link SQLDialect#ORACLE}). In order to prevent such problems, you could
* use {@link Settings#isInListPadding()} to produce less distinct SQL
* strings (see also
* [#5600]), or you
* could avoid IN
lists, and replace them with:
*
* NOT IN
predicates on temporary tables
* NOT IN
predicates on unnested array bind variables
*
*/
@NotNull
@Support
Condition notIn(Result extends Record1> result);
/**
* Create a condition to check this field against several values.
*
* Note that if any of the passed values is NULL
, then the
* condition will be NULL
(or false
, depending on
* the dialect) as well. This is standard SQL behaviour.
*
* SQL: this not in (values…)
*
* Note that generating dynamic SQL with arbitrary-length
* NOT IN
predicates can cause cursor cache contention in some
* databases that use unique SQL strings as a statement identifier (e.g.
* {@link SQLDialect#ORACLE}). In order to prevent such problems, you could
* use {@link Settings#isInListPadding()} to produce less distinct SQL
* strings (see also
* [#5600]), or you
* could avoid IN
lists, and replace them with:
*
* NOT IN
predicates on temporary tables
* NOT IN
predicates on unnested array bind variables
*
*/
@NotNull
@Support
Condition notIn(T... values);
/**
* Create a condition to check this field against several values.
*
* Note that if any of the passed values is NULL
, then the
* condition will be NULL
(or false
, depending on
* the dialect) as well. This is standard SQL behaviour.
*
* SQL: this not in (values…)
*/
@NotNull
@Support
Condition notIn(Field>... values);
// ------------------------------------------------------------------------
// BETWEEN predicates
// ------------------------------------------------------------------------
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling between(minValue).and(maxValue)
*
* SQL: this between minValue and maxValue
*/
@NotNull
@Support
Condition between(T minValue, T maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling between(minValue).and(maxValue)
*
* SQL: this between minValue and maxValue
*/
@NotNull
@Support
Condition between(Field minValue, Field maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling
* betweenSymmetric(minValue).and(maxValue)
*
* SQL: this between symmetric minValue and maxValue
*/
@NotNull
@Support
Condition betweenSymmetric(T minValue, T maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling
* betweenSymmetric(minValue).and(maxValue)
*
* SQL: this between symmetric minValue and maxValue
*/
@NotNull
@Support
Condition betweenSymmetric(Field minValue, Field maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling
* notBetween(minValue).and(maxValue)
*
* SQL: this not between minValue and maxValue
*/
@NotNull
@Support
Condition notBetween(T minValue, T maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling
* notBetween(minValue).and(maxValue)
*
* SQL: this not between minValue and maxValue
*/
@NotNull
@Support
Condition notBetween(Field minValue, Field maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling
* notBetweenSymmetric(minValue).and(maxValue)
*
* SQL: this not between symmetric minValue and maxValue
*/
@NotNull
@Support
Condition notBetweenSymmetric(T minValue, T maxValue);
/**
* Create a condition to check this field against some bounds.
*
* This is the same as calling
* notBetweenSymmetric(minValue).and(maxValue)
*
* SQL: this not between symmetric minValue and maxValue
*/
@NotNull
@Support
Condition notBetweenSymmetric(Field minValue, Field maxValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this between minValue and maxValue
*/
@NotNull
@Support
BetweenAndStep between(T minValue);
/**
* Create a condition to check this field against some bounds.
*