org.jooq.Field Maven / Gradle / Ivy
/**
* Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* 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
*
* http://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: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
// ...
// ...
import static org.jooq.SQLDialect.CUBRID;
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.H2;
// ...
import static org.jooq.SQLDialect.HSQLDB;
// ...
// ...
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 java.math.BigDecimal;
import java.util.Collection;
import java.util.Map;
import org.jooq.conf.Settings;
import org.jooq.impl.DSL;
import org.jooq.types.Interval;
// ...
/**
* A field used in tables and conditions
*
* Note that all fields qualify as {@link GroupField}, i.e. they can always be
* used in GROUP BY
clauses
*
* @param The field type
* @author Lukas Eder
*/
public interface Field extends SelectField, GroupField {
// ------------------------------------------------------------------------
// 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}
*
*/
@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
.
*/
String getComment();
/**
* The field's underlying {@link Converter}.
*
* By default, all fields reference an identity-converter
* Converter<T, T>
. Custom data types may be obtained by a
* custom {@link Converter} placed on the generated {@link TableField}.
*/
@Override
Converter, T> getConverter();
/**
* The field's underlying {@link Binding}.
*/
@Override
Binding, T> getBinding();
/**
* The Java type of the field.
*/
@Override
Class getType();
/**
* The type of this field (might not be dialect-specific).
*/
@Override
DataType getDataType();
/**
* The dialect-specific type of this field.
*/
@Override
DataType getDataType(Configuration configuration);
/**
* Create an alias for this field.
*
* Note that the case-sensitivity of the returned field depends on
* {@link Settings#getRenderNameStyle()}. By default, field aliases are
* quoted, and thus case-sensitive!
*
* @param alias The alias name
* @return The field alias
*/
@Support
Field as(String alias);
/**
* Create an alias for this field based on another field's name.
*
* Note that the case-sensitivity of the returned field depends on
* {@link Settings#getRenderNameStyle()}. By default, field aliases are
* quoted, and thus case-sensitive!
*
* @param otherField The other field whose name this field is aliased with.
* @return The field alias.
*/
@Support
Field as(Field> otherField);
/**
* {@inheritDoc}
*
* Watch out! This is {@link Object#equals(Object)}, not a jOOQ DSL
* feature!
*/
@Override
boolean equals(Object other);
// ------------------------------------------------------------------------
// 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)
*/
@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
*/
@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.
*
* @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)
*/
@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)
*/
@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)
*/
@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);
*
*
* @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)
*/
@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
*/
@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
*/
@Support
SortField desc();
/**
* Create an ascending/descending sort field from this field.
*
* @param order The sort order
* @return This field as an ascending/descending sort field.
*/
@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
*/
@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
*/
@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
*/
@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
*/
@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
*/
@Support
SortField sort(Map sortMap);
// ------------------------------------------------------------------------
// Arithmetic operations
// ------------------------------------------------------------------------
/**
* Negate this field to get its negative value.
*
* This renders the same on all dialects: -[this]
*/
@Support
Field neg();
/**
* An arithmetic expression adding this to value.
*
* @see #add(Field)
*/
@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
*
*
*/
@Support
Field add(Field> value);
/**
* An alias for {@link #add(Number)}.
*
* @see #add(Number)
*/
@Support
Field plus(Number value);
/**
* An alias for {@link #add(Field)}.
*
* @see #add(Field)
*/
@Support
Field plus(Field> value);
/**
* An arithmetic expression subtracting value from this.
*
* @see #sub(Field)
*/
@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)}
*
*/
@Support
Field sub(Field> value);
/**
* An alias for {@link #sub(Number)}.
*
* @see #sub(Number)
*/
@Support
Field subtract(Number value);
/**
* An alias for {@link #sub(Field)}.
*
* @see #sub(Field)
*/
@Support
Field subtract(Field> value);
/**
* An alias for {@link #sub(Number)}.
*
* @see #sub(Number)
*/
@Support
Field minus(Number value);
/**
* An alias for {@link #sub(Field)}.
*
* @see #sub(Field)
*/
@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})
*
*/
@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})
*
*/
@Support
Field mul(Field extends Number> value);
/**
* An alias for {@link #mul(Number)}.
*
* @see #mul(Number)
*/
@Support
Field multiply(Number value);
/**
* An alias for {@link #mul(Field)}.
*
* @see #mul(Field)
*/
@Support
Field multiply(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})
*
*/
@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})
*
*/
@Support
Field div(Field extends Number> value);
/**
* An alias for {@link #div(Number)}.
*
* @see #div(Number)
*/
@Support
Field divide(Number value);
/**
* An alias for {@link #div(Field)}.
*
* @see #div(Field)
*/
@Support
Field divide(Field extends Number> value);
/**
* An arithmetic expression getting the modulo of this divided by value.
*
* This renders the modulo operation where available:
* [this] % [value]
... or the modulo function
* elsewhere: mod([this], [value])
*/
@Support
Field mod(Number value);
/**
* An arithmetic expression getting the modulo of this divided by value.
*
* This renders the modulo operation where available:
* [this] % [value]
... or the modulo function
* elsewhere: mod([this], [value])
*/
@Support
Field mod(Field extends Number> value);
/**
* An alias for {@link #mod(Number)}.
*
* @see #mod(Number)
*/
@Support
Field modulo(Number value);
/**
* An alias for {@link #mod(Field)}.
*
* @see #mod(Field)
*/
@Support
Field modulo(Field extends Number> value);
// ------------------------------------------------------------------------
// Bitwise operations
// ------------------------------------------------------------------------
/**
* The bitwise not operator.
*
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitNot();
/**
* The bitwise and operator.
*
* @see DSL#bitAnd(Field, Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitAnd(T value);
/**
* The bitwise and operator.
*
* @see DSL#bitAnd(Field, Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitAnd(Field value);
/**
* The bitwise not and operator.
*
* @see DSL#bitNand(Field, Field)
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitNand(T value);
/**
* The bitwise not and operator.
*
* @see DSL#bitNand(Field, Field)
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitNand(Field value);
/**
* The bitwise or operator.
*
* @see DSL#bitOr(Field, Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitOr(T value);
/**
* The bitwise or operator.
*
* @see DSL#bitOr(Field, Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitOr(Field value);
/**
* The bitwise not or operator.
*
* @see DSL#bitNor(Field, Field)
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitNor(T value);
/**
* The bitwise not or operator.
*
* @see DSL#bitNor(Field, Field)
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitNor(Field value);
/**
* The bitwise xor operator.
*
* @see DSL#bitXor(Field, Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitXor(T value);
/**
* The bitwise xor operator.
*
* @see DSL#bitXor(Field, Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitXor(Field value);
/**
* The bitwise not xor operator.
*
* @see DSL#bitXNor(Field, Field)
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitXNor(T value);
/**
* The bitwise not xor operator.
*
* @see DSL#bitXNor(Field, Field)
* @see DSL#bitNot(Field)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field bitXNor(Field value);
/**
* The bitwise left shift operator.
*
* @see DSL#shl(Field, Field)
* @see DSL#power(Field, Number)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field shl(T value);
/**
* The bitwise left shift operator.
*
* @see DSL#shl(Field, Field)
* @see DSL#power(Field, Number)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field shl(Field value);
/**
* The bitwise right shift operator.
*
* @see DSL#shr(Field, Field)
* @see DSL#power(Field, Number)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field shr(T value);
/**
* The bitwise right shift operator.
*
* @see DSL#shr(Field, Field)
* @see DSL#power(Field, Number)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Field shr(Field value);
// ------------------------------------------------------------------------
// NULL predicates
// ------------------------------------------------------------------------
/**
* Create a condition to check this field against null
.
*
* SQL: this is null
*/
@Support
Condition isNull();
/**
* Create a condition to check this field against null
.
*
* SQL: this is not null
*/
@Support
Condition isNotNull();
// ------------------------------------------------------------------------
// DISTINCT predicates
// ------------------------------------------------------------------------
/**
* Create a condition to check if this field is DISTINCT
from
* another value.
*
* In {@link SQLDialect#MYSQL} and {@link SQLDialect#MARIADB}, this can be
* emulated through not([this] <=> [value])
*
* In {@link SQLDialect#SQLITE}, this can be emulated through
* [this] IS NOT [value]
*
* If this is not supported by the underlying database, jOOQ will render
* this instead:
* CASE WHEN [this] IS NULL AND [value] IS NULL THEN FALSE
* WHEN [this] IS NULL AND [value] IS NOT NULL THEN TRUE
* WHEN [this] IS NOT NULL AND [value] IS NULL THEN TRUE
* WHEN [this] = [value] THEN FALSE
* ELSE TRUE
* END
*
SQL: this is distinct from value
*/
@Support
Condition isDistinctFrom(T value);
/**
* Create a condition to check if this field is DISTINCT
from
* another field.
*
* In {@link SQLDialect#MYSQL} and {@link SQLDialect#MARIADB}, this can be
* emulated through not([this] <=> [value])
*
* In {@link SQLDialect#SQLITE}, this can be emulated through
* [this] IS NOT [value]
*
* If this is not supported by the underlying database, jOOQ will render
* this instead:
* CASE WHEN [this] IS NULL AND [field] IS NULL THEN FALSE
* WHEN [this] IS NULL AND [field] IS NOT NULL THEN TRUE
* WHEN [this] IS NOT NULL AND [field] IS NULL THEN TRUE
* WHEN [this] = [field] THEN FALSE
* ELSE TRUE
* END
*
SQL: this is distinct from field
*/
@Support
Condition isDistinctFrom(Field field);
/**
* Create a condition to check if this field is NOT DISTINCT
* from another value.
*
* In {@link SQLDialect#MYSQL} and {@link SQLDialect#MARIADB}, this can be
* emulated through [this] <=> [value]
*
* In {@link SQLDialect#SQLITE}, this can be emulated through
* [this] IS [value]
*
* If this is not supported by the underlying database, jOOQ will render
* this instead:
* CASE WHEN [this] IS NULL AND [value] IS NULL THEN TRUE
* WHEN [this] IS NULL AND [value] IS NOT NULL THEN FALSE
* WHEN [this] IS NOT NULL AND [value] IS NULL THEN FALSE
* WHEN [this] = [value] THEN TRUE
* ELSE FALSE
* END
*
SQL: this is not distinct from value
*/
@Support
Condition isNotDistinctFrom(T value);
/**
* Create a condition to check if this field is NOT DISTINCT
* from another field.
*
* In {@link SQLDialect#MYSQL} and {@link SQLDialect#MARIADB}, this can be
* emulated through [this] <=> [value]
*
* In {@link SQLDialect#SQLITE}, this can be emulated through
* [this] IS [value]
*
* If this is not supported by the underlying database, jOOQ will render
* this instead:
* CASE WHEN [this] IS NULL AND [field] IS NULL THEN TRUE
* WHEN [this] IS NULL AND [field] IS NOT NULL THEN FALSE
* WHEN [this] IS NOT NULL AND [field] IS NULL THEN FALSE
* WHEN [this] = [value] THEN TRUE
* ELSE FALSE
* END
*
SQL: this is not distinct from field
*/
@Support
Condition isNotDistinctFrom(Field field);
// ------------------------------------------------------------------------
// 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#CUBRID}
* [search] REGEXP [pattern]
* POSIX
* http://www.cubrid.org/manual/841/en/REGEXP Conditional Expression
*
*
* {@link SQLDialect#DB2}
* -
* -
* -
*
*
* {@link SQLDialect#DERBY}
* -
* -
* -
*
*
* {@link SQLDialect#H2}
* [search] REGEXP [pattern]
* Java
* http
* ://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)
*/
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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)
*/
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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)
*/
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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)
*/
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition notLikeRegex(Field pattern);
// ------------------------------------------------------------------------
// LIKE predicates
// ------------------------------------------------------------------------
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this like value
*/
@Support
Condition like(Field value);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this like value escape 'e'
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition like(Field value, char escape);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this like value
*/
@Support
Condition like(String value);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this like value escape 'e'
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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.
*/
@Support
Condition likeIgnoreCase(Field field);
/**
* 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.
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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.
*/
@Support
Condition likeIgnoreCase(String value);
/**
* 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.
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition likeIgnoreCase(String value, char escape);
/**
* Create a condition to pattern-check this field against a field.
*
* SQL: this not like field
*/
@Support
Condition notLike(Field field);
/**
* Create a condition to pattern-check this field against a field.
*
* SQL: this not like field escape 'e'
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition notLike(Field field, char escape);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this not like value
*/
@Support
Condition notLike(String value);
/**
* Create a condition to pattern-check this field against a value.
*
* SQL: this not like value escape 'e'
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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.
*/
@Support
Condition notLikeIgnoreCase(Field field);
/**
* 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.
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
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.
*/
@Support
Condition notLikeIgnoreCase(String value);
/**
* 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.
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition notLikeIgnoreCase(String value, char escape);
/**
* Convenience method for {@link #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.
*
* @see DSL#escape(String, char)
* @see #like(String, char)
*/
@Support
Condition contains(T value);
/**
* Convenience method for {@link #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.
*
* @see DSL#escape(Field, char)
* @see #like(Field, char)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition contains(Field value);
/**
* Convenience method for {@link #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)
*
* @see DSL#escape(String, char)
* @see #like(String, char)
*/
@Support
Condition startsWith(T value);
/**
* Convenience method for {@link #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)
*
* @see DSL#escape(Field, char)
* @see #like(Field, char)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition startsWith(Field value);
/**
* Convenience method for {@link #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)
*
* @see DSL#escape(String, char)
* @see #like(String, char)
*/
@Support
Condition endsWith(T value);
/**
* Convenience method for {@link #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)
*
* @see DSL#escape(Field, char)
* @see #like(Field, char)
*/
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Condition endsWith(Field value);
// ------------------------------------------------------------------------
// IN predicates
// ------------------------------------------------------------------------
/**
* Create a condition to check this field against several values.
*
* SQL: this in (values...)
*/
@Support
Condition in(Collection> values);
/**
* Create a condition to check this field against several values from a
* previous query.
*
* SQL: this in (values...)
*/
Condition in(Result extends Record1> result);
/**
* Create a condition to check this field against several values.
*
* SQL: this in (values...)
*/
@Support
Condition in(T... values);
/**
* Create a condition to check this field against several values.
*
* SQL: this in (values...)
*/
@Support
Condition in(Field>... values);
/**
* Create a condition to check this field against a subquery.
*
* Note that 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.
*
* SQL: this in (select...)
*/
@Support
Condition in(Select extends Record1> query);
/**
* 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...)
*/
@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...)
*/
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...)
*/
@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...)
*/
@Support
Condition notIn(Field>... values);
/**
* Create a condition to check this field against a subquery.
*
* Note that 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.
*
* 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 (select...)
*/
@Support
Condition notIn(Select extends Record1> query);
// ------------------------------------------------------------------------
// 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
*/
@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
*/
@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
*/
@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
*/
@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
*/
@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
*/
@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
*/
@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
*/
@Support
Condition notBetweenSymmetric(Field minValue, Field maxValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this between minValue and maxValue
*/
@Support
BetweenAndStep between(T minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this between minValue and maxValue
*/
@Support
BetweenAndStep between(Field minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this between symmetric minValue and maxValue
*/
@Support
BetweenAndStep betweenSymmetric(T minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this between symmetric minValue and maxValue
*/
@Support
BetweenAndStep betweenSymmetric(Field minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this not between minValue and maxValue
*/
@Support
BetweenAndStep notBetween(T minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this not between minValue and maxValue
*/
@Support
BetweenAndStep notBetween(Field minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this not between symmetric minValue and maxValue
*/
@Support
BetweenAndStep notBetweenSymmetric(T minValue);
/**
* Create a condition to check this field against some bounds.
*
* SQL: this not between symmetric minValue and maxValue
*/
@Support
BetweenAndStep notBetweenSymmetric(Field minValue);
// ------------------------------------------------------------------------
// Dynamic comparison predicates
// ------------------------------------------------------------------------
/**
* Compare this field with a value using a dynamic comparator.
*
* @param comparator The comparator to use for comparing this field with a
* value
* @param value The value to compare this field with
* @return A comparison predicate
*/
@Support
Condition compare(Comparator comparator, T value);
/**
* Compare this field with another field using a dynamic comparator.
*
* @param comparator The comparator to use for comparing this field with
* another field
* @param field The field to compare this field with
* @return A comparison predicate
*/
@Support
Condition compare(Comparator comparator, Field field);
/**
* Compare this field with a subselect using a dynamic comparator.
*
* Consider {@link Comparator#supportsSubselect()} to assess whether a
* comparator can be used with this method.
*
* @param comparator The comparator to use for comparing this field with a
* subselect
* @param query The subselect to compare this field with
* @return A comparison predicate
*/
@Support
Condition compare(Comparator comparator, Select extends Record1> query);
/**
* Compare this field with a quantified subselect using a dynamic
* comparator.
*
* Consider {@link Comparator#supportsQuantifier()} to assess whether a
* comparator can be used with this method.
*
* @param comparator The comparator to use for comparing this field with a
* quantified subselect
* @param query The quantified subselect to compare this field with
* @return A comparison predicate
*/
@Support
Condition compare(Comparator comparator, QuantifiedSelect extends Record1> query);
// ------------------------------------------------------------------------
// Comparison predicates
// ------------------------------------------------------------------------
/**
* this = value
.
*/
@Support
Condition equal(T value);
/**
* this = field
.
*/
@Support
Condition equal(Field field);
/**
* this = (Select<?> ...)
.
*/
@Support
Condition equal(Select extends Record1> query);
/**
* this = [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition equal(QuantifiedSelect extends Record1> query);
/**
* this = value
.
*
* @see #equal(Object)
*/
@Support
Condition eq(T value);
/**
* this = field
.
*
* @see #equal(Field)
*/
@Support
Condition eq(Field field);
/**
* this = (Select<?> ...)
.
*
* @see #equal(Select)
*/
@Support
Condition eq(Select extends Record1> query);
/**
* this = [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition eq(QuantifiedSelect extends Record1> query);
/**
* this != value
.
*/
@Support
Condition notEqual(T value);
/**
* this != field
.
*/
@Support
Condition notEqual(Field field);
/**
* this != (Select<?> ...)
.
*/
@Support
Condition notEqual(Select extends Record1> query);
/**
* this != [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition notEqual(QuantifiedSelect extends Record1> query);
/**
* this != value
.
*
* @see #notEqual(Object)
*/
@Support
Condition ne(T value);
/**
* this != field
.
*
* @see #notEqual(Field)
*/
@Support
Condition ne(Field field);
/**
* this != (Select<?> ...)
.
*
* @see #notEqual(Select)
*/
@Support
Condition ne(Select extends Record1> query);
/**
* this != [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition ne(QuantifiedSelect extends Record1> query);
/**
* this < value
.
*/
@Support
Condition lessThan(T value);
/**
* this < field
.
*/
@Support
Condition lessThan(Field field);
/**
* this < (Select<?> ...)
.
*/
@Support
Condition lessThan(Select extends Record1> query);
/**
* this < [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition lessThan(QuantifiedSelect extends Record1> query);
/**
* this < value
.
*
* @see #lessThan(Object)
*/
@Support
Condition lt(T value);
/**
* this < field
.
*
* @see #lessThan(Field)
*/
@Support
Condition lt(Field field);
/**
* this < (Select<?> ...)
.
*
* @see #lessThan(Select)
*/
@Support
Condition lt(Select extends Record1> query);
/**
* this < [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition lt(QuantifiedSelect extends Record1> query);
/**
* this <= value
.
*/
@Support
Condition lessOrEqual(T value);
/**
* this <= field
.
*/
@Support
Condition lessOrEqual(Field field);
/**
* this <= (Select<?> ...)
.
*/
@Support
Condition lessOrEqual(Select extends Record1> query);
/**
* this <= [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition lessOrEqual(QuantifiedSelect extends Record1> query);
/**
* this <= value
.
*
* @see #lessOrEqual(Object)
*/
@Support
Condition le(T value);
/**
* this <= field
.
*
* @see #lessOrEqual(Field)
*/
@Support
Condition le(Field field);
/**
* this <= (Select<?> ...)
.
*
* @see #lessOrEqual(Select)
*/
@Support
Condition le(Select extends Record1> query);
/**
* this <= [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition le(QuantifiedSelect extends Record1> query);
/**
* this > value
.
*/
@Support
Condition greaterThan(T value);
/**
* this > field
.
*/
@Support
Condition greaterThan(Field field);
/**
* this > (Select<?> ...)
.
*/
@Support
Condition greaterThan(Select extends Record1> query);
/**
* this > [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition greaterThan(QuantifiedSelect extends Record1> query);
/**
* this > value
.
*
* @see #greaterThan(Object)
*/
@Support
Condition gt(T value);
/**
* this > field
.
*
* @see #greaterThan(Field)
*/
@Support
Condition gt(Field field);
/**
* this > (Select<?> ...)
.
*
* @see #greaterThan(Select)
*/
@Support
Condition gt(Select extends Record1> query);
/**
* this > [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition gt(QuantifiedSelect extends Record1> query);
/**
* this >= value
.
*/
@Support
Condition greaterOrEqual(T value);
/**
* this >= field
.
*/
@Support
Condition greaterOrEqual(Field field);
/**
* this >= (Select<?> ...)
.
*/
@Support
Condition greaterOrEqual(Select extends Record1> query);
/**
* this >= [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition greaterOrEqual(QuantifiedSelect extends Record1> query);
/**
* this >= value
.
*
* @see #greaterOrEqual(Object)
*/
@Support
Condition ge(T value);
/**
* this >= field
.
*
* @see #greaterOrEqual(Field)
*/
@Support
Condition ge(Field field);
/**
* this >= (Select<?> ...)
.
*
* @see #greaterOrEqual(Select)
*/
@Support
Condition ge(Select extends Record1> query);
/**
* this >= [quantifier] (Select<?> ...)
.
*
* @see DSL#all(Field)
* @see DSL#all(Select)
* @see DSL#all(Object...)
* @see DSL#any(Field)
* @see DSL#any(Select)
* @see DSL#any(Object...)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Condition ge(QuantifiedSelect extends Record1> query);
/**
* Create a condition to check this field against known string literals for
* true
.
*
* SQL:
* lcase(this) in ("1", "y", "yes", "true", "on", "enabled")
*/
@Support
Condition isTrue();
/**
* Create a condition to check this field against known string literals for
* false
.
*
* SQL:
* lcase(this) in ("0", "n", "no", "false", "off", "disabled")
*/
@Support
Condition isFalse();
/**
* lower(this) = lower(value)
.
*/
@Support
Condition equalIgnoreCase(String value);
/**
* lower(this) = lower(value)
.
*/
@Support
Condition equalIgnoreCase(Field value);
/**
* lower(this) != lower(value)
.
*/
@Support
Condition notEqualIgnoreCase(String value);
/**
* lower(this) != lower(value)
.
*/
@Support
Condition notEqualIgnoreCase(Field value);
// ------------------------------------------------------------------------
// Pre-2.0 API. This API is maintained for backwards-compatibility. It will
// be removed in the future. Consider using equivalent methods from
// org.jooq.impl.DSL
// ------------------------------------------------------------------------
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#sign(Field)
*/
@Support
Field sign();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#abs(Field)
*/
@Support
Field abs();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#round(Field)
*/
@Support
Field round();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#round(Field, int)
*/
@Support
Field round(int decimals);
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#floor(Field)
*/
@Support
Field floor();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#ceil(Field)
*/
@Support
Field ceil();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#sqrt(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field sqrt();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#exp(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field exp();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#ln(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field ln();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#log(Field, int)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field log(int base);
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#power(Field, Number)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field pow(Number exponent);
/**
* An alias for {@link #power(Number)}.
*
* @see #power(Number)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field power(Number exponent);
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#acos(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field acos();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#asin(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field asin();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#atan(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field atan();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#atan2(Field, Number)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field atan2(Number y);
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#atan2(Field, Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field atan2(Field extends Number> y);
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#cos(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field cos();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#sin(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field sin();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#tan(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field tan();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#cot(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field cot();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#sinh(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field sinh();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#cosh(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field cosh();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#tanh(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field tanh();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#coth(Field)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Field coth();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#deg(Field)
*/
@Support
Field deg();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#rad(Field)
*/
@Support
Field rad();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#count(Field)
*/
@Support
Field count();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#countDistinct(Field)
*/
@Support
Field countDistinct();
/**
* This method is part of the pre-2.0 API. This API is maintained for
* backwards-compatibility. It may be removed in the future. Consider using
* equivalent methods from {@link DSLContext}
*
* @see DSL#max(Field)
*/
@Support
Field