All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jooq.impl.DSL Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2009-2016, 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.impl;

import static java.util.Arrays.asList;
import static org.jooq.Operator.AND;
import static org.jooq.Operator.OR;
// ...
// ...
import static org.jooq.SQLDialect.CUBRID;
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.FIREBIRD_3_0;
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.POSTGRES_9_3;
import static org.jooq.SQLDialect.POSTGRES_9_4;
import static org.jooq.SQLDialect.POSTGRES_9_5;
// ...
import static org.jooq.SQLDialect.SQLITE;
// ...
// ...
// ...
// ...
import static org.jooq.impl.Term.ROW_NUMBER;
import static org.jooq.impl.Tools.EMPTY_FIELD;
import static org.jooq.impl.Tools.combine;
import static org.jooq.impl.Tools.configuration;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.time.temporal.Temporal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import java.util.function.Function;

import javax.annotation.Generated;
import javax.sql.DataSource;

import org.jooq.AggregateFunction;
import org.jooq.AlterIndexStep;
import org.jooq.AlterSchemaStep;
import org.jooq.AlterSequenceStep;
import org.jooq.AlterTableStep;
import org.jooq.AlterViewStep;
import org.jooq.ArrayAggOrderByStep;
// ...
import org.jooq.Case;
import org.jooq.CaseConditionStep;
import org.jooq.CaseValueStep;
import org.jooq.Catalog;
import org.jooq.CommonTableExpression;
import org.jooq.Condition;
import org.jooq.Configuration;
import org.jooq.ConnectionProvider;
import org.jooq.ConstraintFinalStep;
import org.jooq.ConstraintForeignKeyReferencesStep1;
import org.jooq.ConstraintForeignKeyReferencesStep10;
import org.jooq.ConstraintForeignKeyReferencesStep11;
import org.jooq.ConstraintForeignKeyReferencesStep12;
import org.jooq.ConstraintForeignKeyReferencesStep13;
import org.jooq.ConstraintForeignKeyReferencesStep14;
import org.jooq.ConstraintForeignKeyReferencesStep15;
import org.jooq.ConstraintForeignKeyReferencesStep16;
import org.jooq.ConstraintForeignKeyReferencesStep17;
import org.jooq.ConstraintForeignKeyReferencesStep18;
import org.jooq.ConstraintForeignKeyReferencesStep19;
import org.jooq.ConstraintForeignKeyReferencesStep2;
import org.jooq.ConstraintForeignKeyReferencesStep20;
import org.jooq.ConstraintForeignKeyReferencesStep21;
import org.jooq.ConstraintForeignKeyReferencesStep22;
import org.jooq.ConstraintForeignKeyReferencesStep3;
import org.jooq.ConstraintForeignKeyReferencesStep4;
import org.jooq.ConstraintForeignKeyReferencesStep5;
import org.jooq.ConstraintForeignKeyReferencesStep6;
import org.jooq.ConstraintForeignKeyReferencesStep7;
import org.jooq.ConstraintForeignKeyReferencesStep8;
import org.jooq.ConstraintForeignKeyReferencesStep9;
import org.jooq.ConstraintForeignKeyReferencesStepN;
import org.jooq.ConstraintTypeStep;
import org.jooq.CreateIndexStep;
import org.jooq.CreateSchemaFinalStep;
import org.jooq.CreateSequenceFinalStep;
import org.jooq.CreateTableAsStep;
import org.jooq.CreateViewAsStep;
import org.jooq.DSLContext;
import org.jooq.DataType;
import org.jooq.DatePart;
import org.jooq.Delete;
import org.jooq.DeleteWhereStep;
import org.jooq.DerivedColumnList;
import org.jooq.DropIndexOnStep;
import org.jooq.DropSchemaStep;
import org.jooq.DropSequenceFinalStep;
import org.jooq.DropTableStep;
import org.jooq.DropViewFinalStep;
import org.jooq.Field;
import org.jooq.FieldOrRow;
import org.jooq.GroupConcatOrderByStep;
import org.jooq.GroupField;
import org.jooq.Insert;
import org.jooq.InsertSetStep;
import org.jooq.InsertValuesStep1;
import org.jooq.InsertValuesStep10;
import org.jooq.InsertValuesStep11;
import org.jooq.InsertValuesStep12;
import org.jooq.InsertValuesStep13;
import org.jooq.InsertValuesStep14;
import org.jooq.InsertValuesStep15;
import org.jooq.InsertValuesStep16;
import org.jooq.InsertValuesStep17;
import org.jooq.InsertValuesStep18;
import org.jooq.InsertValuesStep19;
import org.jooq.InsertValuesStep2;
import org.jooq.InsertValuesStep20;
import org.jooq.InsertValuesStep21;
import org.jooq.InsertValuesStep22;
import org.jooq.InsertValuesStep3;
import org.jooq.InsertValuesStep4;
import org.jooq.InsertValuesStep5;
import org.jooq.InsertValuesStep6;
import org.jooq.InsertValuesStep7;
import org.jooq.InsertValuesStep8;
import org.jooq.InsertValuesStep9;
import org.jooq.InsertValuesStepN;
import org.jooq.Keyword;
// ...
import org.jooq.MergeKeyStep1;
import org.jooq.MergeKeyStep10;
import org.jooq.MergeKeyStep11;
import org.jooq.MergeKeyStep12;
import org.jooq.MergeKeyStep13;
import org.jooq.MergeKeyStep14;
import org.jooq.MergeKeyStep15;
import org.jooq.MergeKeyStep16;
import org.jooq.MergeKeyStep17;
import org.jooq.MergeKeyStep18;
import org.jooq.MergeKeyStep19;
import org.jooq.MergeKeyStep2;
import org.jooq.MergeKeyStep20;
import org.jooq.MergeKeyStep21;
import org.jooq.MergeKeyStep22;
import org.jooq.MergeKeyStep3;
import org.jooq.MergeKeyStep4;
import org.jooq.MergeKeyStep5;
import org.jooq.MergeKeyStep6;
import org.jooq.MergeKeyStep7;
import org.jooq.MergeKeyStep8;
import org.jooq.MergeKeyStep9;
import org.jooq.MergeKeyStepN;
import org.jooq.MergeUsingStep;
import org.jooq.Name;
import org.jooq.Operator;
import org.jooq.OrderedAggregateFunction;
import org.jooq.OrderedAggregateFunctionOfDeferredType;
import org.jooq.Param;
import org.jooq.PlainSQL;
import org.jooq.QuantifiedSelect;
import org.jooq.Queries;
import org.jooq.Query;
import org.jooq.QueryPart;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record10;
import org.jooq.Record11;
import org.jooq.Record12;
import org.jooq.Record13;
import org.jooq.Record14;
import org.jooq.Record15;
import org.jooq.Record16;
import org.jooq.Record17;
import org.jooq.Record18;
import org.jooq.Record19;
import org.jooq.Record2;
import org.jooq.Record20;
import org.jooq.Record21;
import org.jooq.Record22;
import org.jooq.Record3;
import org.jooq.Record4;
import org.jooq.Record5;
import org.jooq.Record6;
import org.jooq.Record7;
import org.jooq.Record8;
import org.jooq.Record9;
import org.jooq.RecordHandler;
import org.jooq.RecordType;
import org.jooq.Result;
import org.jooq.ResultQuery;
import org.jooq.Row1;
import org.jooq.Row10;
import org.jooq.Row11;
import org.jooq.Row12;
import org.jooq.Row13;
import org.jooq.Row14;
import org.jooq.Row15;
import org.jooq.Row16;
import org.jooq.Row17;
import org.jooq.Row18;
import org.jooq.Row19;
import org.jooq.Row2;
import org.jooq.Row20;
import org.jooq.Row21;
import org.jooq.Row22;
import org.jooq.Row3;
import org.jooq.Row4;
import org.jooq.Row5;
import org.jooq.Row6;
import org.jooq.Row7;
import org.jooq.Row8;
import org.jooq.Row9;
import org.jooq.RowN;
import org.jooq.SQL;
import org.jooq.SQLDialect;
import org.jooq.Schema;
import org.jooq.Select;
import org.jooq.SelectField;
import org.jooq.SelectSelectStep;
import org.jooq.SelectWhereStep;
import org.jooq.Sequence;
import org.jooq.SortField;
import org.jooq.Support;
import org.jooq.Table;
import org.jooq.TableLike;
import org.jooq.TruncateIdentityStep;
import org.jooq.UDTRecord;
import org.jooq.Update;
import org.jooq.UpdateSetFirstStep;
import org.jooq.WindowIgnoreNullsStep;
import org.jooq.WindowOverStep;
import org.jooq.WindowSpecification;
import org.jooq.WindowSpecificationFinalStep;
import org.jooq.WindowSpecificationOrderByStep;
import org.jooq.WindowSpecificationRowsAndStep;
import org.jooq.WindowSpecificationRowsStep;
import org.jooq.WithAsStep;
import org.jooq.WithAsStep1;
import org.jooq.WithAsStep10;
import org.jooq.WithAsStep11;
import org.jooq.WithAsStep12;
import org.jooq.WithAsStep13;
import org.jooq.WithAsStep14;
import org.jooq.WithAsStep15;
import org.jooq.WithAsStep16;
import org.jooq.WithAsStep17;
import org.jooq.WithAsStep18;
import org.jooq.WithAsStep19;
import org.jooq.WithAsStep2;
import org.jooq.WithAsStep20;
import org.jooq.WithAsStep21;
import org.jooq.WithAsStep22;
import org.jooq.WithAsStep3;
import org.jooq.WithAsStep4;
import org.jooq.WithAsStep5;
import org.jooq.WithAsStep6;
import org.jooq.WithAsStep7;
import org.jooq.WithAsStep8;
import org.jooq.WithAsStep9;
import org.jooq.WithStep;
import org.jooq.conf.RenderNameStyle;
import org.jooq.conf.Settings;
import org.jooq.exception.SQLDialectNotSupportedException;
import org.jooq.tools.Convert;
import org.jooq.tools.jdbc.JDBCUtils;
import org.jooq.types.DayToSecond;
import org.jooq.types.UByte;
import org.jooq.types.UInteger;
import org.jooq.types.ULong;
import org.jooq.types.UShort;

/**
 * A DSL "entry point" providing implementations to the org.jooq
 * interfaces.
 * 

* The {@link DSLContext} and this DSL are the main entry point for * client code, to access jOOQ classes and functionality. Here, you can * instantiate all of those objects that cannot be accessed through other * objects. For example, to create a {@link Field} representing a constant * value, you can write: *

*

 * Field<String> field = DSL.val("Hello World")
 * 
*

* Another example is the EXISTS clause, which you can apply to any * SELECT to form a {@link Condition}: *

*

 * Condition condition = DSL.exists(DSL.select(...));
 * 
*

*

DSL and static imports
*

* For increased fluency and readability of your jOOQ client code, it is * recommended that you static import all methods from the DSL. For * example:

 * import static org.jooq.impl.DSL.*;
 *
 * public class Main {
 *   public static void main(String[] args) {
 *     DSL.select(val("Hello"), inline("World"));
 *     // DSL.val ^^^           ^^^^^^ DSL.inline
 *   }
 * }
 * 
*

* In order to use the "contextual DSL", call one of the various overloaded * {@link #using(Configuration)} methods: *

*

 * // Create and immediately execute a SELECT statement:
 * DSL.using(connection, dialect)
 *    .selectOne()
 *    .fetch();
 * 
* * @see DSLContext * @author Lukas Eder */ @SuppressWarnings({ "unchecked", "rawtypes" }) public class DSL { // ------------------------------------------------------------------------- // XXX Contextual factory methods // ------------------------------------------------------------------------- /** * Create an executor with a dialect configured. *

* Without a connection or data source, this executor cannot execute * queries. Use it to render SQL only. * * @param dialect The dialect to use with objects created from this executor */ public static DSLContext using(SQLDialect dialect) { return new DefaultDSLContext(dialect, null); } /** * Create an executor with a dialect and settings configured. *

* Without a connection or data source, this executor cannot execute * queries. Use it to render SQL only. * * @param dialect The dialect to use with objects created from this executor * @param settings The runtime settings to apply to objects created from * this executor */ public static DSLContext using(SQLDialect dialect, Settings settings) { return new DefaultDSLContext(dialect, settings); } /** * Create an executor from a JDBC connection URL. *

* Clients must ensure connections are closed properly by calling * {@link DSLContext#close()} on the resulting {@link DSLContext}. For * example: *

*

     * // Auto-closing DSLContext instance to free resources
     * try (DSLContext ctx = DSL.using("jdbc:h2:~/test")) {
     *
     *     // ...
     * }
     * 
* * @param url The connection URL. * @see DefaultConnectionProvider * @see JDBCUtils#dialect(String) */ public static DSLContext using(String url) { try { Connection connection = DriverManager.getConnection(url); return using(new DefaultConnectionProvider(connection, true), JDBCUtils.dialect(connection)); } catch (SQLException e) { throw Tools.translate("Error when initialising Connection", e); } } /** * Create an executor from a JDBC connection URL. *

* Clients must ensure connections are closed properly by calling * {@link DSLContext#close()} on the resulting {@link DSLContext}. For * example: *

*

     * // Auto-closing DSLContext instance to free resources
     * try (DSLContext ctx = DSL.using("jdbc:h2:~/test", "sa", "")) {
     *
     *     // ...
     * }
     * 
* * @param url The connection URL. * @param username The connection user name. * @param password The connection password. * @see DefaultConnectionProvider * @see JDBCUtils#dialect(String) */ public static DSLContext using(String url, String username, String password) { try { Connection connection = DriverManager.getConnection(url, username, password); return using(new DefaultConnectionProvider(connection, true), JDBCUtils.dialect(connection)); } catch (SQLException e) { throw Tools.translate("Error when initialising Connection", e); } } /** * Create an executor from a JDBC connection URL. *

* Clients must ensure connections are closed properly by calling * {@link DSLContext#close()} on the resulting {@link DSLContext}. For * example: *

*

     * // Auto-closing DSLContext instance to free resources
     * try (DSLContext ctx = DSL.using("jdbc:h2:~/test", properties)) {
     *
     *     // ...
     * }
     * 
* * @param url The connection URL. * @param properties The connection properties. * @see DefaultConnectionProvider * @see JDBCUtils#dialect(String) */ public static DSLContext using(String url, Properties properties) { try { Connection connection = DriverManager.getConnection(url, properties); return using(new DefaultConnectionProvider(connection, true), JDBCUtils.dialect(connection)); } catch (SQLException e) { throw Tools.translate("Error when initialising Connection", e); } } /** * Create an executor with a connection configured. *

* If you provide a JDBC connection to a jOOQ Configuration, jOOQ will use * that connection directly for creating statements. *

* This is a convenience constructor for * {@link #using(Connection, Settings)}, guessing the {@link SQLDialect} * using {@link JDBCUtils#dialect(Connection)} * * @param connection The connection to use with objects created from this * executor * @see DefaultConnectionProvider * @see JDBCUtils#dialect(Connection) */ public static DSLContext using(Connection connection) { return new DefaultDSLContext(connection, JDBCUtils.dialect(connection), null); } /** * Create an executor with a connection and a dialect configured. *

* If you provide a JDBC connection to a jOOQ Configuration, jOOQ will use * that connection directly for creating statements. *

* This is a convenience constructor for * {@link #using(ConnectionProvider, SQLDialect, Settings)} using a * {@link DefaultConnectionProvider} * * @param connection The connection to use with objects created from this * executor * @param dialect The dialect to use with objects created from this executor * @see DefaultConnectionProvider */ public static DSLContext using(Connection connection, SQLDialect dialect) { return new DefaultDSLContext(connection, dialect, null); } /** * Create an executor with a connection, a dialect and settings configured. *

* If you provide a JDBC connection to a jOOQ Configuration, jOOQ will use * that connection directly for creating statements. *

* This is a convenience constructor for * {@link #using(ConnectionProvider, SQLDialect, Settings)} using a * {@link DefaultConnectionProvider} and guessing the {@link SQLDialect} * using {@link JDBCUtils#dialect(Connection)} * * @param connection The connection to use with objects created from this * executor * @param settings The runtime settings to apply to objects created from * this executor * @see DefaultConnectionProvider * @see JDBCUtils#dialect(Connection) */ public static DSLContext using(Connection connection, Settings settings) { return new DefaultDSLContext(connection, JDBCUtils.dialect(connection), settings); } /** * Create an executor with a connection, a dialect and settings configured. *

* If you provide a JDBC connection to a jOOQ Configuration, jOOQ will use * that connection directly for creating statements. *

* This is a convenience constructor for * {@link #using(ConnectionProvider, SQLDialect, Settings)} using a * {@link DefaultConnectionProvider} * * @param connection The connection to use with objects created from this * executor * @param dialect The dialect to use with objects created from this executor * @param settings The runtime settings to apply to objects created from * this executor * @see DefaultConnectionProvider */ public static DSLContext using(Connection connection, SQLDialect dialect, Settings settings) { return new DefaultDSLContext(connection, dialect, settings); } /** * Create an executor with a data source and a dialect configured. *

* If you provide a JDBC data source to a jOOQ Configuration, jOOQ will use * that data source for initialising connections, and creating statements. *

* This is a convenience constructor for * {@link #using(ConnectionProvider, SQLDialect)} using a * {@link DataSourceConnectionProvider} * * @param datasource The data source to use with objects created from this * executor * @param dialect The dialect to use with objects created from this executor * @see DataSourceConnectionProvider */ public static DSLContext using(DataSource datasource, SQLDialect dialect) { return new DefaultDSLContext(datasource, dialect); } /** * Create an executor with a data source, a dialect and settings configured. *

* If you provide a JDBC data source to a jOOQ Configuration, jOOQ will use * that data source for initialising connections, and creating statements. *

* This is a convenience constructor for * {@link #using(ConnectionProvider, SQLDialect, Settings)} using a * {@link DataSourceConnectionProvider} * * @param datasource The data source to use with objects created from this * executor * @param dialect The dialect to use with objects created from this executor * @param settings The runtime settings to apply to objects created from * this executor * @see DataSourceConnectionProvider */ public static DSLContext using(DataSource datasource, SQLDialect dialect, Settings settings) { return new DefaultDSLContext(datasource, dialect, settings); } /** * Create an executor with a custom connection provider and a dialect * configured. * * @param connectionProvider The connection provider providing jOOQ with * JDBC connections * @param dialect The dialect to use with objects created from this executor */ public static DSLContext using(ConnectionProvider connectionProvider, SQLDialect dialect) { return new DefaultDSLContext(connectionProvider, dialect); } /** * Create an executor with a custom connection provider, a dialect and settings * configured. * * @param connectionProvider The connection provider providing jOOQ with * JDBC connections * @param dialect The dialect to use with objects created from this executor * @param settings The runtime settings to apply to objects created from * this executor */ public static DSLContext using(ConnectionProvider connectionProvider, SQLDialect dialect, Settings settings) { return new DefaultDSLContext(connectionProvider, dialect, settings); } /** * Create an executor from a custom configuration. * * @param configuration The configuration */ public static DSLContext using(Configuration configuration) { return new DefaultDSLContext(configuration); } // ------------------------------------------------------------------------- // XXX Static subselect factory methods // ------------------------------------------------------------------------- /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String)} for strictly non-recursive CTE * and {@link #withRecursive(String)} for strictly * recursive CTE. */ @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep with(String alias) { return new WithImpl(null, false).with(alias); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep with(String alias, String... fieldAliases) { return new WithImpl(null, false).with(alias, fieldAliases); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE and * {@link #withRecursive(String, String...)} for strictly recursive CTE. *

* This works in a similar way as {@link #with(String, String...)}, except * that all column names are produced by a function that receives the CTE's * {@link Select} columns as input. */ @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep with(String alias, Function, ? extends String> fieldNameFunction) { return new WithImpl(null, false).with(alias, fieldNameFunction); } // [jooq-tools] START [with] /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep1 with(String alias, String fieldAlias1) { return new WithImpl(null, false).with(alias, fieldAlias1); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep2 with(String alias, String fieldAlias1, String fieldAlias2) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep3 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep4 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep5 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep6 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep7 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep8 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep9 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep10 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep11 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep12 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep13 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep14 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep15 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep16 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep17 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep18 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep19 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep20 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19, String fieldAlias20) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19, fieldAlias20); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep21 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19, String fieldAlias20, String fieldAlias21) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19, fieldAlias20, fieldAlias21); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithAsStep22 with(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19, String fieldAlias20, String fieldAlias21, String fieldAlias22) { return new WithImpl(null, false).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19, fieldAlias20, fieldAlias21, fieldAlias22); } // [jooq-tools] END [with] /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* Reusable {@link CommonTableExpression} types can be constructed through *

    *
  • {@link #name(String...)}
  • *
  • {@link Name#fields(String...)}
  • *
  • * {@link DerivedColumnList#as(Select)}
  • *
*

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(CommonTableExpression...)} for strictly non-recursive CTE * and {@link #withRecursive(CommonTableExpression...)} for strictly * recursive CTE. */ @Support({ FIREBIRD, HSQLDB, POSTGRES }) public static WithStep with(CommonTableExpression... tables) { return new WithImpl(null, false).with(tables); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String)} for strictly non-recursive CTE * and {@link #withRecursive(String)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep withRecursive(String alias) { return new WithImpl(null, true).with(alias); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep withRecursive(String alias, String... fieldAliases) { return new WithImpl(null, true).with(alias, fieldAliases); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. *

* This works in a similar way as {@link #with(String, String...)}, except * that all column names are produced by a function that receives the CTE's * {@link Select} columns as input. */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep withRecursive(String alias, Function, ? extends String> fieldNameFunction) { return new WithImpl(null, true).with(alias, fieldNameFunction); } // [jooq-tools] START [with-recursive] /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep1 withRecursive(String alias, String fieldAlias1) { return new WithImpl(null, true).with(alias, fieldAlias1); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep2 withRecursive(String alias, String fieldAlias1, String fieldAlias2) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep3 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep4 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep5 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep6 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep7 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep8 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep9 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep10 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep11 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep12 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep13 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep14 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep15 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep16 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep17 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep18 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep19 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep20 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19, String fieldAlias20) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19, fieldAlias20); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep21 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19, String fieldAlias20, String fieldAlias21) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19, fieldAlias20, fieldAlias21); } /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(String, String...)} for strictly non-recursive CTE * and {@link #withRecursive(String, String...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithAsStep22 withRecursive(String alias, String fieldAlias1, String fieldAlias2, String fieldAlias3, String fieldAlias4, String fieldAlias5, String fieldAlias6, String fieldAlias7, String fieldAlias8, String fieldAlias9, String fieldAlias10, String fieldAlias11, String fieldAlias12, String fieldAlias13, String fieldAlias14, String fieldAlias15, String fieldAlias16, String fieldAlias17, String fieldAlias18, String fieldAlias19, String fieldAlias20, String fieldAlias21, String fieldAlias22) { return new WithImpl(null, true).with(alias, fieldAlias1, fieldAlias2, fieldAlias3, fieldAlias4, fieldAlias5, fieldAlias6, fieldAlias7, fieldAlias8, fieldAlias9, fieldAlias10, fieldAlias11, fieldAlias12, fieldAlias13, fieldAlias14, fieldAlias15, fieldAlias16, fieldAlias17, fieldAlias18, fieldAlias19, fieldAlias20, fieldAlias21, fieldAlias22); } // [jooq-tools] END [with-recursive] /** * Create a WITH clause to supply subsequent * SELECT, UPDATE, INSERT, * DELETE, and MERGE statements with * {@link CommonTableExpression}s. *

* Reusable {@link CommonTableExpression} types can be constructed through *

    *
  • {@link #name(String...)}
  • *
  • {@link Name#fields(String...)}
  • *
  • * {@link DerivedColumnList#as(Select)}
  • *
*

* The RECURSIVE keyword may be optional or unsupported in some * databases, in case of which it will not be rendered. For optimal database * interoperability and readability, however, it is suggested that you use * {@link #with(CommonTableExpression...)} for strictly non-recursive CTE * and {@link #withRecursive(CommonTableExpression...)} for strictly * recursive CTE. *

* Note that the {@link SQLDialect#H2} database only supports single-table, * RECURSIVE common table expression lists. */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static WithStep withRecursive(CommonTableExpression... tables) { return new WithImpl(null, true).with(tables); } /** * Create a new DSL select statement. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * SELECT * FROM [table] WHERE [conditions] ORDER BY [ordering] LIMIT [limit clause]
     * 
*/ @Support public static SelectWhereStep selectFrom(Table table) { return new SelectImpl(new DefaultConfiguration(), null).from(table); } /** * Create a new DSL subselect statement. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(fields)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
*

* Note that passing an empty collection conveniently produces * SELECT * semantics, i.e. it: *

    *
  • Renders SELECT tab1.col1, tab1.col2, ..., tabN.colN if * all columns are known
  • *
  • Renders SELECT * if not all columns are known, e.g. when * using plain SQL
  • *
* * @see DSLContext#select(Collection) */ @Support public static SelectSelectStep select(Collection> fields) { return new SelectImpl(new DefaultConfiguration(), null).select(fields); } /** * Create a new DSL subselect statement. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
*

* Note that passing an empty collection conveniently produces * SELECT * semantics, i.e. it: *

    *
  • Renders SELECT tab1.col1, tab1.col2, ..., tabN.colN if * all columns are known
  • *
  • Renders SELECT * if not all columns are known, e.g. when * using plain SQL
  • *
* * @see DSLContext#select(SelectField...) */ @Support public static SelectSelectStep select(SelectField... fields) { return new SelectImpl(new DefaultConfiguration(), null).select(fields); } // [jooq-tools] START [select] /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1) { return (SelectSelectStep) select(new SelectField[] { field1 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2) { return (SelectSelectStep) select(new SelectField[] { field1, field2 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, field4)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, field4, field5)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field5, field6)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field6, field7)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field7, field8)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field8, field9)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field9, field10)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field10, field11)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field11, field12)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field12, field13)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field13, field14)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field14, field15)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field15, field16)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field16, field17)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field17, field18)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field18, field19)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field19, field20)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19, SelectField field20) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field20, field21)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19, SelectField field20, SelectField field21) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #select(Field...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * select(field1, field2, field3, .., field21, field22)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#select(SelectField...) * @see #select(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> select(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19, SelectField field20, SelectField field21, SelectField field22) { return (SelectSelectStep) select(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22 }); } // [jooq-tools] END [select] /** * Create a new DSL subselect statement. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(fields)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
*

* Note that passing an empty collection conveniently produces * SELECT DISTINCT * semantics, i.e. it: *

    *
  • Renders SELECT DISTINCT tab1.col1, tab1.col2, ..., tabN.colN if * all columns are known
  • *
  • Renders SELECT DISTINCT * if not all columns are known, e.g. when * using plain SQL
  • *
* * @see DSLContext#selectDistinct(Collection) */ @Support public static SelectSelectStep selectDistinct(Collection> fields) { return new SelectImpl(new DefaultConfiguration(), null, true).select(fields); } /** * Create a new DSL subselect statement. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
*

* Note that passing an empty collection conveniently produces * SELECT DISTINCT * semantics, i.e. it: *

    *
  • Renders SELECT DISTINCT tab1.col1, tab1.col2, ..., tabN.colN if * all columns are known
  • *
  • Renders SELECT DISTINCT * if not all columns are known, e.g. when * using plain SQL
  • *
* * @see DSLContext#selectDistinct(SelectField...) */ @Support public static SelectSelectStep selectDistinct(SelectField... fields) { return new SelectImpl(new DefaultConfiguration(), null, true).select(fields); } // [jooq-tools] START [selectDistinct] /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, field4)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, field4, field5)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field5, field6)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field6, field7)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field7, field8)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field8, field9)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field9, field10)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field10, field11)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field11, field12)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field12, field13)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field13, field14)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field14, field15)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field15, field16)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field16, field17)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field17, field18)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field18, field19)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field19, field20)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19, SelectField field20) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field20, field21)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19, SelectField field20, SelectField field21) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21 }); } /** * Create a new DSL subselect statement. *

* This is the same as {@link #selectDistinct(Field...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectDistinct(field1, field2, field3, .., field21, field22)
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSLContext#selectDistinct(SelectField...) * @see #selectDistinct(SelectField...) */ @Generated("This method was generated using jOOQ-tools") @Support public static SelectSelectStep> selectDistinct(SelectField field1, SelectField field2, SelectField field3, SelectField field4, SelectField field5, SelectField field6, SelectField field7, SelectField field8, SelectField field9, SelectField field10, SelectField field11, SelectField field12, SelectField field13, SelectField field14, SelectField field15, SelectField field16, SelectField field17, SelectField field18, SelectField field19, SelectField field20, SelectField field21, SelectField field22) { return (SelectSelectStep) selectDistinct(new SelectField[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22 }); } // [jooq-tools] END [selectDistinct] /** * Create a new DSL subselect statement for a constant 0 * literal. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectZero()
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSL#zero() * @see DSLContext#selectZero() */ @Support public static SelectSelectStep> selectZero() { return new SelectImpl(new DefaultConfiguration(), null).select(zero().as("zero")); } /** * Create a new DSL subselect statement for a constant 1 * literal. *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectOne()
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSL#one() * @see DSLContext#selectOne() */ @Support public static SelectSelectStep> selectOne() { return new SelectImpl(new DefaultConfiguration(), null).select(one().as("one")); } /** * Create a new DSL subselect statement for COUNT(*). *

* Unlike {@link Select} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * SELECT statement. You can use this statement in two ways: *

    *
  • As a subselect within another select
  • *
  • As a statement, after attaching it using * {@link Select#attach(org.jooq.Configuration)}
  • *
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * selectCount()
     *  .from(table1)
     *  .join(table2).on(field1.equal(field2))
     *  .where(field1.greaterThan(100))
     *  .orderBy(field2);
     * 
* * @see DSL#count() * @see DSLContext#selectCount() */ @Support public static SelectSelectStep> selectCount() { return new SelectImpl(new DefaultConfiguration(), null).select(count()); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* This type of insert may feel more convenient to some users, as it uses * the UPDATE statement's SET a = b syntax. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table)
     *   .set(field1, value1)
     *   .set(field2, value2)
     *   .newRecord()
     *   .set(field1, value3)
     *   .set(field2, value4)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table) */ @Support public static InsertSetStep insertInto(Table into) { return using(new DefaultConfiguration()).insertInto(into); } // [jooq-tools] START [insert] /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1)
     *   .values(field1)
     *   .values(field1)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep1 insertInto(Table into, Field field1) { return (InsertValuesStep1) insertInto(into, new Field[] { field1 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2)
     *   .values(field1, field2)
     *   .values(field1, field2)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep2 insertInto(Table into, Field field1, Field field2) { return (InsertValuesStep2) insertInto(into, new Field[] { field1, field2 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3)
     *   .values(field1, field2, field3)
     *   .values(field1, field2, field3)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep3 insertInto(Table into, Field field1, Field field2, Field field3) { return (InsertValuesStep3) insertInto(into, new Field[] { field1, field2, field3 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, field4)
     *   .values(field1, field2, field3, field4)
     *   .values(field1, field2, field3, field4)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep4 insertInto(Table into, Field field1, Field field2, Field field3, Field field4) { return (InsertValuesStep4) insertInto(into, new Field[] { field1, field2, field3, field4 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, field4, field5)
     *   .values(field1, field2, field3, field4, field5)
     *   .values(field1, field2, field3, field4, field5)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep5 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5) { return (InsertValuesStep5) insertInto(into, new Field[] { field1, field2, field3, field4, field5 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field5, field6)
     *   .values(valueA1, valueA2, valueA3, .., valueA5, valueA6)
     *   .values(valueB1, valueB2, valueB3, .., valueB5, valueB6)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep6 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6) { return (InsertValuesStep6) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field6, field7)
     *   .values(valueA1, valueA2, valueA3, .., valueA6, valueA7)
     *   .values(valueB1, valueB2, valueB3, .., valueB6, valueB7)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep7 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7) { return (InsertValuesStep7) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field7, field8)
     *   .values(valueA1, valueA2, valueA3, .., valueA7, valueA8)
     *   .values(valueB1, valueB2, valueB3, .., valueB7, valueB8)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep8 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8) { return (InsertValuesStep8) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field8, field9)
     *   .values(valueA1, valueA2, valueA3, .., valueA8, valueA9)
     *   .values(valueB1, valueB2, valueB3, .., valueB8, valueB9)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep9 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9) { return (InsertValuesStep9) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field9, field10)
     *   .values(valueA1, valueA2, valueA3, .., valueA9, valueA10)
     *   .values(valueB1, valueB2, valueB3, .., valueB9, valueB10)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep10 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10) { return (InsertValuesStep10) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field10, field11)
     *   .values(valueA1, valueA2, valueA3, .., valueA10, valueA11)
     *   .values(valueB1, valueB2, valueB3, .., valueB10, valueB11)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep11 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11) { return (InsertValuesStep11) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field11, field12)
     *   .values(valueA1, valueA2, valueA3, .., valueA11, valueA12)
     *   .values(valueB1, valueB2, valueB3, .., valueB11, valueB12)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep12 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12) { return (InsertValuesStep12) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field12, field13)
     *   .values(valueA1, valueA2, valueA3, .., valueA12, valueA13)
     *   .values(valueB1, valueB2, valueB3, .., valueB12, valueB13)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep13 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13) { return (InsertValuesStep13) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field13, field14)
     *   .values(valueA1, valueA2, valueA3, .., valueA13, valueA14)
     *   .values(valueB1, valueB2, valueB3, .., valueB13, valueB14)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep14 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14) { return (InsertValuesStep14) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field14, field15)
     *   .values(valueA1, valueA2, valueA3, .., valueA14, valueA15)
     *   .values(valueB1, valueB2, valueB3, .., valueB14, valueB15)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep15 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15) { return (InsertValuesStep15) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field15, field16)
     *   .values(valueA1, valueA2, valueA3, .., valueA15, valueA16)
     *   .values(valueB1, valueB2, valueB3, .., valueB15, valueB16)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep16 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16) { return (InsertValuesStep16) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field16, field17)
     *   .values(valueA1, valueA2, valueA3, .., valueA16, valueA17)
     *   .values(valueB1, valueB2, valueB3, .., valueB16, valueB17)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep17 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17) { return (InsertValuesStep17) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field17, field18)
     *   .values(valueA1, valueA2, valueA3, .., valueA17, valueA18)
     *   .values(valueB1, valueB2, valueB3, .., valueB17, valueB18)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep18 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18) { return (InsertValuesStep18) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field18, field19)
     *   .values(valueA1, valueA2, valueA3, .., valueA18, valueA19)
     *   .values(valueB1, valueB2, valueB3, .., valueB18, valueB19)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep19 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19) { return (InsertValuesStep19) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field19, field20)
     *   .values(valueA1, valueA2, valueA3, .., valueA19, valueA20)
     *   .values(valueB1, valueB2, valueB3, .., valueB19, valueB20)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep20 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20) { return (InsertValuesStep20) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field20, field21)
     *   .values(valueA1, valueA2, valueA3, .., valueA20, valueA21)
     *   .values(valueB1, valueB2, valueB3, .., valueB20, valueB21)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep21 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21) { return (InsertValuesStep21) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21 }); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2, field3, .., field21, field22)
     *   .values(valueA1, valueA2, valueA3, .., valueA21, valueA22)
     *   .values(valueB1, valueB2, valueB3, .., valueB21, valueB22)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field, Field) */ @Generated("This method was generated using jOOQ-tools") @Support public static InsertValuesStep22 insertInto(Table into, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21, Field field22) { return (InsertValuesStep22) insertInto(into, new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22 }); } // [jooq-tools] END [insert] /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2)
     *   .values(valueA1, valueA2)
     *   .values(valueB1, valueB2)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Field...) */ @Support public static InsertValuesStepN insertInto(Table into, Field... fields) { return using(new DefaultConfiguration()).insertInto(into, fields); } /** * Create a new DSL insert statement. *

* Unlike {@link Insert} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * INSERT statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * insertInto(table, field1, field2)
     *   .values(valueA1, valueA2)
     *   .values(valueB1, valueB2)
     *   .onDuplicateKeyUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     * 
* * @see DSLContext#insertInto(Table, Collection) */ @Support public static InsertValuesStepN insertInto(Table into, Collection> fields) { return using(new DefaultConfiguration()).insertInto(into, fields); } /** * Create a new DSL update statement. *

* Unlike {@link Update} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * UPDATE statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * update(table)
     *   .set(field1, value1)
     *   .set(field2, value2)
     *   .where(field1.greaterThan(100))
     * 
*

* Note that some databases support table expressions more complex than * simple table references. In CUBRID and MySQL, for instance, you can write *

     * update(t1.join(t2).on(t1.id.eq(t2.id)))
     *   .set(t1.value, value1)
     *   .set(t2.value, value2)
     *   .where(t1.id.eq(10))
     * 
*/ @Support public static UpdateSetFirstStep update(Table table) { return using(new DefaultConfiguration()).update(table); } /** * Create a new DSL SQL standard MERGE statement. *

* Unlike {@link Merge} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * MERGE statement. *

* This statement is available from DSL syntax only. It is known to be * supported in some way by any of these dialects: *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
dialectsupport typedocumentation
CUBRIDSQL:2008 standard and some enhancementshttp://www.cubrid.org/manual/90/en/MERGE
DB2SQL:2008 standard and major enhancementshttp://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com. * ibm.db2.udb.admin.doc/doc/r0010873.htm
HSQLDBSQL:2008 standardhttp://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html#N129BA
OracleSQL:2008 standard and minor enhancementshttp://download.oracle.com/docs/cd/B28359_01/server.111/b28286/ * statements_9016.htm
SQL ServerSimilar to SQL:2008 standard with some major enhancementshttp://msdn.microsoft.com/de-de/library/bb510625.aspx
SybaseSimilar to SQL:2008 standard with some major enhancementshttp://dcx.sybase.com/1100/en/dbreference_en11/merge-statement.html
*

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * mergeInto(table)
     *   .using(select)
     *   .on(condition)
     *   .whenMatchedThenUpdate()
     *   .set(field1, value1)
     *   .set(field2, value2)
     *   .whenNotMatchedThenInsert(field1, field2)
     *   .values(value1, value2)
     * 
*

* Note: Using this method, you can also create an H2-specific MERGE * statement without field specification. See also * {@link #mergeInto(Table, Field...)} * * @see DSLContext#mergeInto(Table) */ @Support({ CUBRID, FIREBIRD_3_0, HSQLDB }) public static MergeUsingStep mergeInto(Table table) { return using(new DefaultConfiguration()).mergeInto(table); } // [jooq-tools] START [merge] /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep1 mergeInto(Table table, Field field1) { return using(new DefaultConfiguration()).mergeInto(table, field1); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep2 mergeInto(Table table, Field field1, Field field2) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep3 mergeInto(Table table, Field field1, Field field2, Field field3) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep4 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep5 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep6 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep7 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep8 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep9 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep10 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep11 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep12 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep13 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep14 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep15 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep16 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep17 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep18 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep19 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep20 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep21 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21); } /** * Create a new DSL UPSERT statement ({@link SQLDialect#H2} * MERGE) or {@link SQLDialect#HANA} UPSERT). * * @see DSLContext#mergeInto(Table, Field...) */ @Generated("This method was generated using jOOQ-tools") @Support({ CUBRID, FIREBIRD_3_0, H2, HSQLDB, MARIADB, MYSQL, POSTGRES_9_5 }) public static MergeKeyStep22 mergeInto(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21, Field field22) { return using(new DefaultConfiguration()).mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22); } // [jooq-tools] END [merge] /** * Create a new DSL merge statement (H2-specific syntax). *

* Unlike {@link Merge} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * MERGE statement. *

* This statement is available from DSL syntax only. It is known to be * supported in some way by any of these dialects: *

* * * * * * * * * * *
H2H2 natively supports this special syntaxwww.h2database.com/html/grammar.html#merge
DB2, HSQLDB, Oracle, SQL Server, Sybase SQL AnywhereThese databases can emulate the H2-specific MERGE statement using a * standard SQL MERGE statement, without restrictionsSee {@link #mergeInto(Table)} for the standard MERGE statement
* * @see DSLContext#mergeInto(Table, Field...) */ @Support({ CUBRID, H2, HSQLDB }) public static MergeKeyStepN mergeInto(Table table, Field... fields) { return using(new DefaultConfiguration()).mergeInto(table, fields); } /** * Create a new DSL merge statement (H2-specific syntax). *

* Unlike {@link Merge} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * MERGE statement. * * @see DSLContext#mergeInto(Table, Collection) */ @Support({ CUBRID, H2, HSQLDB }) public static MergeKeyStepN mergeInto(Table table, Collection> fields) { return using(new DefaultConfiguration()).mergeInto(table, fields); } /** * Create a new DSL delete statement. *

* Unlike {@link Delete} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * DELETE statement. *

* Example:

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * deleteFrom(table)
     *   .where(field1.greaterThan(100))
     * 
*

* Some but not all databases support aliased tables in delete statements. * * @see DSLContext#deleteFrom(Table) */ @Support public static DeleteWhereStep deleteFrom(Table table) { return using(new DefaultConfiguration()).deleteFrom(table); } /** * Create a new DSL delete statement. *

* This is an alias for {@link #deleteFrom(Table)} */ @Support public static DeleteWhereStep delete(Table table) { return using(new DefaultConfiguration()).deleteFrom(table); } // ------------------------------------------------------------------------- // XXX DDL Clauses // ------------------------------------------------------------------------- /** * Create an unnamed (system named) CONSTRAINT specification. */ @Support public static ConstraintTypeStep constraint() { return new ConstraintImpl(); } /** * Create a CONSTRAINT specification. */ @Support public static ConstraintTypeStep constraint(Name name) { return new ConstraintImpl(name); } /** * Create a CONSTRAINT specification. */ @Support public static ConstraintTypeStep constraint(String name) { return constraint(name(name)); } /** * Create an unnamed (system named) PRIMARY KEY constraint. */ @Support public static ConstraintFinalStep primaryKey(String... fields) { return constraint().primaryKey(fields); } /** * Create an unnamed (system named) PRIMARY KEY constraint. */ @Support public static ConstraintFinalStep primaryKey(Field... fields) { return constraint().primaryKey(fields); } /** * Add a FOREIGN KEY clause to the CONSTRAINT. */ @Support public static ConstraintForeignKeyReferencesStepN foreignKey(String... fields) { return constraint().foreignKey(fields); } /** * Add a FOREIGN KEY clause to the CONSTRAINT. */ @Support public static ConstraintForeignKeyReferencesStepN foreignKey(Field... fields) { return constraint().foreignKey(fields); } // [jooq-tools] START [foreignKey] /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep1 foreignKey(Field field1) { return constraint().foreignKey(field1); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep2 foreignKey(Field field1, Field field2) { return constraint().foreignKey(field1, field2); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep3 foreignKey(Field field1, Field field2, Field field3) { return constraint().foreignKey(field1, field2, field3); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep4 foreignKey(Field field1, Field field2, Field field3, Field field4) { return constraint().foreignKey(field1, field2, field3, field4); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep5 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5) { return constraint().foreignKey(field1, field2, field3, field4, field5); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep6 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep7 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep8 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep9 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep10 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep11 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep12 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep13 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep14 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep15 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep16 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep17 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep18 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep19 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep20 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep21 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep22 foreignKey(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21, Field field22) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep1 foreignKey(String field1) { return constraint().foreignKey(field1); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep2 foreignKey(String field1, String field2) { return constraint().foreignKey(field1, field2); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep3 foreignKey(String field1, String field2, String field3) { return constraint().foreignKey(field1, field2, field3); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep4 foreignKey(String field1, String field2, String field3, String field4) { return constraint().foreignKey(field1, field2, field3, field4); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep5 foreignKey(String field1, String field2, String field3, String field4, String field5) { return constraint().foreignKey(field1, field2, field3, field4, field5); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep6 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep7 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep8 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep9 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep10 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep11 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep12 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep13 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep14 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep15 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep16 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep17 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep18 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep19 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep20 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19, String field20) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep21 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19, String field20, String field21) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21); } /** * Add an unnamed (system named) FOREIGN KEY clause to the CONSTRAINT. */ @Generated("This method was generated using jOOQ-tools") @Support public static ConstraintForeignKeyReferencesStep22 foreignKey(String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19, String field20, String field21, String field22) { return constraint().foreignKey(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22); } // [jooq-tools] END [foreignKey] /** * Create an unnamed (system named) UNIQUE constraint. */ @Support public static ConstraintFinalStep unique(String... fields) { return constraint().unique(fields); } /** * Create an unnamed (system named) UNIQUE constraint. */ @Support public static ConstraintFinalStep unique(Field... fields) { return constraint().unique(fields); } /** * Create an unnamed (system named) CHECK constraint. */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES, SQLITE }) public static ConstraintFinalStep check(Condition condition) { return constraint().check(condition); } // ------------------------------------------------------------------------- // XXX DDL Statements // ------------------------------------------------------------------------- /** * Create a new DSL CREATE SCHEMA statement. * * @see DSLContext#createSchema(String) */ @Support({ H2, HSQLDB, POSTGRES }) public static CreateSchemaFinalStep createSchema(String schema) { return using(new DefaultConfiguration()).createSchema(schema); } /** * Create a new DSL CREATE SCHEMA statement. * * @see DSLContext#createSchema(Name) */ @Support({ H2, HSQLDB, POSTGRES }) public static CreateSchemaFinalStep createSchema(Name table) { return using(new DefaultConfiguration()).createSchema(table); } /** * Create a new DSL CREATE SCHEMA statement. * * @see DSLContext#createSchema(Schema) */ @Support({ H2, HSQLDB, POSTGRES }) public static CreateSchemaFinalStep createSchema(Schema schema) { return using(new DefaultConfiguration()).createSchema(schema); } /** * Create a new DSL CREATE SCHEMA statement. * * @see DSLContext#createSchemaIfNotExists(String) */ @Support({ H2, POSTGRES }) public static CreateSchemaFinalStep createSchemaIfNotExists(String schema) { return using(new DefaultConfiguration()).createSchemaIfNotExists(schema); } /** * Create a new DSL CREATE SCHEMA statement. * * @see DSLContext#createSchemaIfNotExists(Name) */ @Support({ H2, POSTGRES }) public static CreateSchemaFinalStep createSchemaIfNotExists(Name table) { return using(new DefaultConfiguration()).createSchemaIfNotExists(table); } /** * Create a new DSL CREATE SCHEMA statement. * * @see DSLContext#createSchemaIfNotExists(Schema) */ @Support({ H2, POSTGRES }) public static CreateSchemaFinalStep createSchemaIfNotExists(Schema schema) { return using(new DefaultConfiguration()).createSchemaIfNotExists(schema); } /** * Create a new DSL CREATE TABLE statement. * * @see DSLContext#createTable(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateTableAsStep createTable(String table) { return using(new DefaultConfiguration()).createTable(table); } /** * Create a new DSL CREATE TABLE statement. * * @see DSLContext#createTable(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateTableAsStep createTable(Name table) { return using(new DefaultConfiguration()).createTable(table); } /** * Create a new DSL CREATE TABLE statement. * * @see DSLContext#createTable(Table) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateTableAsStep createTable(Table table) { return using(new DefaultConfiguration()).createTable(table); } /** * Create a new DSL CREATE TABLE statement. * * @see DSLContext#createTableIfNotExists(String) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateTableAsStep createTableIfNotExists(String table) { return using(new DefaultConfiguration()).createTableIfNotExists(table); } /** * Create a new DSL CREATE TABLE statement. * * @see DSLContext#createTableIfNotExists(Name) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateTableAsStep createTableIfNotExists(Name table) { return using(new DefaultConfiguration()).createTableIfNotExists(table); } /** * Create a new DSL CREATE TABLE statement. * * @see DSLContext#createTableIfNotExists(Table) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateTableAsStep createTableIfNotExists(Table table) { return using(new DefaultConfiguration()).createTableIfNotExists(table); } /** * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement. * * @see DSLContext#createTemporaryTable(String) */ @Support({ MARIADB, MYSQL, POSTGRES }) public static CreateTableAsStep createTemporaryTable(String table) { return using(new DefaultConfiguration()).createTemporaryTable(table); } /** * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement. * * @see DSLContext#createTemporaryTable(Name) */ @Support({ MARIADB, MYSQL, POSTGRES }) public static CreateTableAsStep createTemporaryTable(Name table) { return using(new DefaultConfiguration()).createTemporaryTable(table); } /** * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement. * * @see DSLContext#createTemporaryTable(Table) */ @Support({ MARIADB, MYSQL, POSTGRES }) public static CreateTableAsStep createTemporaryTable(Table table) { return using(new DefaultConfiguration()).createTemporaryTable(table); } /** * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement. * * @see DSLContext#createGlobalTemporaryTable(String) */ @Support({ MARIADB, MYSQL, POSTGRES }) public static CreateTableAsStep createGlobalTemporaryTable(String table) { return using(new DefaultConfiguration()).createGlobalTemporaryTable(table); } /** * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement. * * @see DSLContext#createGlobalTemporaryTable(Name) */ @Support({ MARIADB, MYSQL, POSTGRES }) public static CreateTableAsStep createGlobalTemporaryTable(Name table) { return using(new DefaultConfiguration()).createGlobalTemporaryTable(table); } /** * Create a new DSL CREATE GLOBAL TEMPORARY TABLE statement. * * @see DSLContext#createGlobalTemporaryTable(Table) */ @Support({ MARIADB, MYSQL, POSTGRES }) public static CreateTableAsStep createGlobalTemporaryTable(Table table) { return using(new DefaultConfiguration()).createGlobalTemporaryTable(table); } /** * Create a new DSL CREATE VIEW statement. * * @see DSLContext#createView(String, String...) */ @Support public static CreateViewAsStep createView(String view, String... fields) { return using(new DefaultConfiguration()).createView(view, fields); } /** * Create a new DSL CREATE VIEW statement. * * @see DSLContext#createView(Name, Name...) */ @Support public static CreateViewAsStep createView(Name view, Name... fields) { return using(new DefaultConfiguration()).createView(view, fields); } /** * Create a new DSL CREATE VIEW statement. * * @see DSLContext#createView(Table, Field...) */ @Support public static CreateViewAsStep createView(Table view, Field... fields) { return using(new DefaultConfiguration()).createView(view, fields); } /** * Create a new DSL CREATE VIEW statement. *

* This works like {@link #createView(Table, Field...)} except that the * view's field names are derived from the view's {@link Select} statement * using a function. * * @see DSLContext#createView(String, String...) */ @Support public static CreateViewAsStep createView(String view, Function, ? extends String> fieldNameFunction) { return using(new DefaultConfiguration()).createView(view, fieldNameFunction); } /** * Create a new DSL CREATE VIEW statement. *

* This works like {@link #createView(Table, Field...)} except that the * view's field names are derived from the view's {@link Select} statement * using a function. * * @see DSLContext#createView(Name, Name...) */ @Support public static CreateViewAsStep createView(Name view, Function, ? extends Name> fieldNameFunction) { return using(new DefaultConfiguration()).createView(view, fieldNameFunction); } /** * Create a new DSL CREATE VIEW statement. *

* This works like {@link #createView(Table, Field...)} except that the * view's field names are derived from the view's {@link Select} statement * using a function. * * @see DSLContext#createView(Table, Field...) */ @Support public static CreateViewAsStep createView(Table view, Function, ? extends Field> fieldNameFunction) { return using(new DefaultConfiguration()).createView(view, fieldNameFunction); } /** * Create a new DSL CREATE VIEW IF NOT EXISTS statement. * * @see DSLContext#createViewIfNotExists(String, String...) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateViewAsStep createViewIfNotExists(String view, String... fields) { return using(new DefaultConfiguration()).createViewIfNotExists(view, fields); } /** * Create a new DSL CREATE VIEW IF NOT EXISTS statement. * * @see DSLContext#createViewIfNotExists(Name, Name...) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateViewAsStep createViewIfNotExists(Name view, Name... fields) { return using(new DefaultConfiguration()).createViewIfNotExists(view, fields); } /** * Create a new DSL CREATE VIEW IF NOT EXISTS statement. * * @see DSLContext#createViewIfNotExists(Table, Field...) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateViewAsStep createViewIfNotExists(Table view, Field... fields) { return using(new DefaultConfiguration()).createViewIfNotExists(view, fields); } /** * Create a new DSL CREATE VIEW IF NOT EXISTS statement. *

* This works like {@link #createViewIfNotExists(String, String...)} except that the * view's field names are derived from the view's {@link Select} statement * using a function. * * @see DSLContext#createViewIfNotExists(String, String...) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateViewAsStep createViewIfNotExists(String view, Function, ? extends String> fieldNameFunction) { return using(new DefaultConfiguration()).createViewIfNotExists(view, fieldNameFunction); } /** * Create a new DSL CREATE VIEW IF NOT EXISTS statement. *

* This works like {@link #createViewIfNotExists(Name, Name...)} except that the * view's field names are derived from the view's {@link Select} statement * using a function. * * @see DSLContext#createViewIfNotExists(Name, Name...) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateViewAsStep createViewIfNotExists(Name view, Function, ? extends Name> fieldNameFunction) { return using(new DefaultConfiguration()).createViewIfNotExists(view, fieldNameFunction); } /** * Create a new DSL CREATE VIEW IF NOT EXISTS statement. *

* This works like {@link #createViewIfNotExists(Table, Field...)} except that the * view's field names are derived from the view's {@link Select} statement * using a function. * * @see DSLContext#createViewIfNotExists(Table, Field...) */ @Support({ FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateViewAsStep createViewIfNotExists(Table view, Function, ? extends Field> fieldNameFunction) { return using(new DefaultConfiguration()).createViewIfNotExists(view, fieldNameFunction); } /** * Create a new DSL CREATE INDEX statement. * * @see DSLContext#createIndex(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateIndexStep createIndex(String index) { return using(new DefaultConfiguration()).createIndex(index); } /** * Create a new DSL CREATE INDEX statement. * * @see DSLContext#createIndex(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateIndexStep createIndex(Name index) { return using(new DefaultConfiguration()).createIndex(index); } /** * Create a new DSL CREATE INDEX IF NOT EXISTS statement. * * @see DSLContext#createIndexIfNotExists(String) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES, SQLITE }) public static CreateIndexStep createIndexIfNotExists(String index) { return using(new DefaultConfiguration()).createIndexIfNotExists(index); } /** * Create a new DSL CREATE INDEX IF NOT EXISTS statement. * * @see DSLContext#createIndexIfNotExists(Name) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES, SQLITE }) public static CreateIndexStep createIndexIfNotExists(Name index) { return using(new DefaultConfiguration()).createIndexIfNotExists(index); } /** * Create a new DSL CREATE UNIQUE INDEX statement. * * @see DSLContext#createUniqueIndex(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateIndexStep createUniqueIndex(String index) { return using(new DefaultConfiguration()).createUniqueIndex(index); } /** * Create a new DSL CREATE UNIQUE INDEX statement. * * @see DSLContext#createUniqueIndex(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static CreateIndexStep createUniqueIndex(Name index) { return using(new DefaultConfiguration()).createUniqueIndex(index); } /** * Create a new DSL CREATE UNIQUE INDEX IF NOT EXISTS statement. * * @see DSLContext#createUniqueIndexIfNotExists(String) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES, SQLITE }) public static CreateIndexStep createUniqueIndexIfNotExists(String index) { return using(new DefaultConfiguration()).createUniqueIndexIfNotExists(index); } /** * Create a new DSL CREATE UNIQUE INDEX IF NOT EXISTS statement. * * @see DSLContext#createUniqueIndexIfNotExists(Name) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES, SQLITE }) public static CreateIndexStep createUniqueIndexIfNotExists(Name index) { return using(new DefaultConfiguration()).createUniqueIndexIfNotExists(index); } /** * Create a new DSL CREATE SEQUENCE statement. * * @see DSLContext#createSequence(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static CreateSequenceFinalStep createSequence(String sequence) { return using(new DefaultConfiguration()).createSequence(sequence); } /** * Create a new DSL CREATE SEQUENCE statement. * * @see DSLContext#createSequence(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static CreateSequenceFinalStep createSequence(Name sequence) { return using(new DefaultConfiguration()).createSequence(sequence); } /** * Create a new DSL CREATE SEQUENCE statement. * * @see DSLContext#createSequence(Sequence) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static CreateSequenceFinalStep createSequence(Sequence sequence) { return using(new DefaultConfiguration()).createSequence(sequence); } /** * Create a new DSL CREATE SEQUENCE IF NOT EXISTS statement. * * @see DSLContext#createSequenceIfNotExists(String) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static CreateSequenceFinalStep createSequenceIfNotExists(String sequence) { return using(new DefaultConfiguration()).createSequenceIfNotExists(sequence); } /** * Create a new DSL CREATE SEQUENCE IF NOT EXISTS statement. * * @see DSLContext#createSequenceIfNotExists(Name) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static CreateSequenceFinalStep createSequenceIfNotExists(Name sequence) { return using(new DefaultConfiguration()).createSequenceIfNotExists(sequence); } /** * Create a new DSL CREATE SEQUENCE IF NOT EXISTS statement. * * @see DSLContext#createSequenceIfNotExists(Sequence) */ @Support({ FIREBIRD, H2, HSQLDB, POSTGRES }) public static CreateSequenceFinalStep createSequenceIfNotExists(Sequence sequence) { return using(new DefaultConfiguration()).createSequenceIfNotExists(sequence); } /** * Create a new DSL ALTER SEQUENCE statement. * * @see DSLContext#alterSequence(String) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, POSTGRES }) public static AlterSequenceStep alterSequence(String sequence) { return using(new DefaultConfiguration()).alterSequence(sequence); } /** * Create a new DSL ALTER SEQUENCE statement. * * @see DSLContext#alterSequence(Name) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, POSTGRES }) public static AlterSequenceStep alterSequence(Name sequence) { return using(new DefaultConfiguration()).alterSequence(sequence); } /** * Create a new DSL ALTER SEQUENCE statement. * * @see DSLContext#alterSequence(Sequence) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, POSTGRES }) public static AlterSequenceStep alterSequence(Sequence sequence) { return using(new DefaultConfiguration()).alterSequence(sequence); } /** * Create a new DSL ALTER SEQUENCE statement. * * @see DSLContext#alterSequenceIfExists(String) */ @Support({ POSTGRES }) public static AlterSequenceStep alterSequenceIfExists(String sequence) { return using(new DefaultConfiguration()).alterSequenceIfExists(sequence); } /** * Create a new DSL ALTER SEQUENCE statement. * * @see DSLContext#alterSequenceIfExists(Name) */ @Support({ POSTGRES }) public static AlterSequenceStep alterSequenceIfExists(Name sequence) { return using(new DefaultConfiguration()).alterSequenceIfExists(sequence); } /** * Create a new DSL ALTER SEQUENCE statement. * * @see DSLContext#alterSequenceIfExists(Sequence) */ @Support({ POSTGRES }) public static AlterSequenceStep alterSequenceIfExists(Sequence sequence) { return using(new DefaultConfiguration()).alterSequenceIfExists(sequence); } /** * Create a new DSL ALTER TABLE statement. * * @see DSLContext#alterTable(String) */ @Support public static AlterTableStep alterTable(String table) { return using(new DefaultConfiguration()).alterTable(table); } /** * Create a new DSL ALTER TABLE statement. * * @see DSLContext#alterTable(Name) */ @Support public static AlterTableStep alterTable(Name table) { return using(new DefaultConfiguration()).alterTable(table); } /** * Create a new DSL ALTER TABLE statement. * * @see DSLContext#alterTable(Table) */ @Support public static AlterTableStep alterTable(Table table) { return using(new DefaultConfiguration()).alterTable(table); } /** * Create a new DSL ALTER TABLE statement. * * @see DSLContext#alterTableIfExists(String) */ @Support({ H2, POSTGRES }) public static AlterTableStep alterTableIfExists(String table) { return using(new DefaultConfiguration()).alterTableIfExists(table); } /** * Create a new DSL ALTER TABLE statement. * * @see DSLContext#alterTableIfExists(Name) */ @Support({ H2, POSTGRES }) public static AlterTableStep alterTableIfExists(Name table) { return using(new DefaultConfiguration()).alterTableIfExists(table); } /** * Create a new DSL ALTER TABLE statement. * * @see DSLContext#alterTableIfExists(Table) */ @Support({ H2, POSTGRES }) public static AlterTableStep alterTableIfExists(Table table) { return using(new DefaultConfiguration()).alterTableIfExists(table); } /** * Create a new DSL ALTER SCHEMA statement. * * @see DSLContext#alterSchema(String) */ @Support({ HSQLDB, POSTGRES }) public static AlterSchemaStep alterSchema(String schema) { return using(new DefaultConfiguration()).alterSchema(schema); } /** * Create a new DSL ALTER SCHEMA statement. * * @see DSLContext#alterSchema(Name) */ @Support({ HSQLDB, POSTGRES }) public static AlterSchemaStep alterSchema(Name schema) { return using(new DefaultConfiguration()).alterSchema(schema); } /** * Create a new DSL ALTER SCHEMA statement. * * @see DSLContext#alterSchema(Schema) */ @Support({ HSQLDB, POSTGRES }) public static AlterSchemaStep alterSchema(Schema schema) { return using(new DefaultConfiguration()).alterSchema(schema); } /** * Create a new DSL ALTER SCHEMA statement. * * @see DSLContext#alterSchemaIfExists(String) */ @Support({ POSTGRES }) public static AlterSchemaStep alterSchemaIfExists(String schema) { return using(new DefaultConfiguration()).alterSchemaIfExists(schema); } /** * Create a new DSL ALTER SCHEMA statement. * * @see DSLContext#alterSchemaIfExists(Name) */ @Support({ POSTGRES }) public static AlterSchemaStep alterSchemaIfExists(Name schema) { return using(new DefaultConfiguration()).alterSchemaIfExists(schema); } /** * Create a new DSL ALTER SCHEMA statement. * * @see DSLContext#alterSchemaIfExists(Schema) */ @Support({ POSTGRES }) public static AlterSchemaStep alterSchemaIfExists(Schema schema) { return using(new DefaultConfiguration()).alterSchemaIfExists(schema); } /** * Create a new DSL ALTER VIEW statement. * * @see DSLContext#alterView(String) */ @Support({ HSQLDB, POSTGRES }) public static AlterViewStep alterView(String view) { return using(new DefaultConfiguration()).alterView(view); } /** * Create a new DSL ALTER VIEW statement. * * @see DSLContext#alterView(Name) */ @Support({ HSQLDB, POSTGRES }) public static AlterViewStep alterView(Name view) { return using(new DefaultConfiguration()).alterView(view); } /** * Create a new DSL ALTER VIEW statement. * * @see DSLContext#alterView(Table) */ @Support({ HSQLDB, POSTGRES }) public static AlterViewStep alterView(Table view) { return using(new DefaultConfiguration()).alterView(view); } /** * Create a new DSL ALTER VIEW statement. * * @see DSLContext#alterViewIfExists(String) */ @Support({ POSTGRES }) public static AlterViewStep alterViewIfExists(String view) { return using(new DefaultConfiguration()).alterViewIfExists(view); } /** * Create a new DSL ALTER VIEW statement. * * @see DSLContext#alterViewIfExists(Name) */ @Support({ POSTGRES }) public static AlterViewStep alterViewIfExists(Name view) { return using(new DefaultConfiguration()).alterViewIfExists(view); } /** * Create a new DSL ALTER VIEW statement. * * @see DSLContext#alterViewIfExists(Table) */ @Support({ POSTGRES }) public static AlterViewStep alterViewIfExists(Table view) { return using(new DefaultConfiguration()).alterViewIfExists(view); } /** * Create a new DSL ALTER INDEX statement. * * @see DSLContext#alterIndex(String) */ @Support({ H2, HSQLDB, POSTGRES }) public static AlterIndexStep alterIndex(String index) { return using(new DefaultConfiguration()).alterIndex(index); } /** * Create a new DSL ALTER INDEX statement. * * @see DSLContext#alterIndex(Name) */ @Support({ H2, HSQLDB, POSTGRES }) public static AlterIndexStep alterIndex(Name index) { return using(new DefaultConfiguration()).alterIndex(index); } /** * Create a new DSL ALTER INDEX statement. * * @see DSLContext#alterIndexIfExists(String) */ @Support({ H2, POSTGRES }) public static AlterIndexStep alterIndexIfExists(String index) { return using(new DefaultConfiguration()).alterIndexIfExists(index); } /** * Create a new DSL ALTER INDEX statement. * * @see DSLContext#alterIndexIfExists(Name) */ @Support({ H2, POSTGRES }) public static AlterIndexStep alterIndexIfExists(Name index) { return using(new DefaultConfiguration()).alterIndexIfExists(index); } /** * Create a new DSL DROP SCHEMA statement. * * @see DSLContext#dropSchema(String) */ @Support({ H2, HSQLDB, POSTGRES }) public static DropSchemaStep dropSchema(String schema){ return using(new DefaultConfiguration()).dropSchema(schema); } /** * Create a new DSL DROP SCHEMA statement. * * @see DSLContext#dropSchema(Name) */ @Support({ H2, HSQLDB, POSTGRES }) public static DropSchemaStep dropSchema(Name schema){ return using(new DefaultConfiguration()).dropSchema(schema); } /** * Create a new DSL DROP SCHEMA statement. * * @see DSLContext#dropSchema(Schema) */ @Support({ H2, HSQLDB, POSTGRES }) public static DropSchemaStep dropSchema(Schema schema){ return using(new DefaultConfiguration()).dropSchema(schema); } /** * Create a new DSL DROP SCHEMA statement. * * @see DSLContext#dropSchemaIfExists(String) */ @Support({ H2, POSTGRES }) public static DropSchemaStep dropSchemaIfExists(String schema){ return using(new DefaultConfiguration()).dropSchemaIfExists(schema); } /** * Create a new DSL DROP SCHEMA statement. * * @see DSLContext#dropSchemaIfExists(Name) */ @Support({ H2, POSTGRES }) public static DropSchemaStep dropSchemaIfExists(Name schema){ return using(new DefaultConfiguration()).dropSchemaIfExists(schema); } /** * Create a new DSL DROP SCHEMA statement. * * @see DSLContext#dropSchemaIfExists(Schema) */ @Support({ H2, POSTGRES }) public static DropSchemaStep dropSchemaIfExists(Schema schema){ return using(new DefaultConfiguration()).dropSchemaIfExists(schema); } /** * Create a new DSL DROP VIEW statement. * * @see DSLContext#dropView(String) */ @Support public static DropViewFinalStep dropView(String view) { return using(new DefaultConfiguration()).dropView(view); } /** * Create a new DSL DROP VIEW statement. * * @see DSLContext#dropView(Name) */ @Support public static DropViewFinalStep dropView(Name view) { return using(new DefaultConfiguration()).dropView(view); } /** * Create a new DSL DROP VIEW statement. * * @see DSLContext#dropView(Table) */ @Support public static DropViewFinalStep dropView(Table view) { return using(new DefaultConfiguration()).dropView(view); } /** * Create a new DSL DROP VIEW IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropViewIfExists(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropViewFinalStep dropViewIfExists(String view) { return using(new DefaultConfiguration()).dropViewIfExists(view); } /** * Create a new DSL DROP VIEW IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropViewIfExists(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropViewFinalStep dropViewIfExists(Name view) { return using(new DefaultConfiguration()).dropViewIfExists(view); } /** * Create a new DSL DROP VIEW IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropViewIfExists(Table) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropViewFinalStep dropViewIfExists(Table view) { return using(new DefaultConfiguration()).dropViewIfExists(view); } /** * Create a new DSL DROP TABLE statement. * * @see DSLContext#dropTable(String) */ @Support public static DropTableStep dropTable(String table) { return using(new DefaultConfiguration()).dropTable(table); } /** * Create a new DSL DROP TABLE statement. * * @see DSLContext#dropTable(Name) */ @Support public static DropTableStep dropTable(Name table) { return using(new DefaultConfiguration()).dropTable(table); } /** * Create a new DSL DROP TABLE statement. * * @see DSLContext#dropTable(Table) */ @Support public static DropTableStep dropTable(Table table) { return using(new DefaultConfiguration()).dropTable(table); } /** * Create a new DSL DROP TABLE IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropTableIfExists(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropTableStep dropTableIfExists(String table) { return using(new DefaultConfiguration()).dropTableIfExists(table); } /** * Create a new DSL DROP TABLE IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropTableIfExists(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropTableStep dropTableIfExists(Name table) { return using(new DefaultConfiguration()).dropTableIfExists(table); } /** * Create a new DSL DROP TABLE IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropTableIfExists(Table) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropTableStep dropTableIfExists(Table table) { return using(new DefaultConfiguration()).dropTableIfExists(table); } /** * Create a new DSL DROP INDEX statement. * * @see DSLContext#dropIndex(String) */ @Support public static DropIndexOnStep dropIndex(String index) { return using(new DefaultConfiguration()).dropIndex(index); } /** * Create a new DSL DROP INDEX statement. * * @see DSLContext#dropIndex(Name) */ @Support public static DropIndexOnStep dropIndex(Name index) { return using(new DefaultConfiguration()).dropIndex(index); } /** * Create a new DSL DROP INDEX IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropIndexIfExists(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropIndexOnStep dropIndexIfExists(String index) { return using(new DefaultConfiguration()).dropIndexIfExists(index); } /** * Create a new DSL DROP INDEX IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropIndexIfExists(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static DropIndexOnStep dropIndexIfExists(Name index) { return using(new DefaultConfiguration()).dropIndexIfExists(index); } /** * Create a new DSL DROP SEQUENCE statement. * * @see DSLContext#dropSequence(String) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static DropSequenceFinalStep dropSequence(String sequence) { return using(new DefaultConfiguration()).dropSequence(sequence); } /** * Create a new DSL DROP SEQUENCE statement. * * @see DSLContext#dropSequence(Name) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static DropSequenceFinalStep dropSequence(Name sequence) { return using(new DefaultConfiguration()).dropSequence(sequence); } /** * Create a new DSL DROP SEQUENCE statement. * * @see DSLContext#dropSequence(Sequence) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static DropSequenceFinalStep dropSequence(Sequence sequence) { return using(new DefaultConfiguration()).dropSequence(sequence); } /** * Create a new DSL DROP SEQUENCE IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropSequenceIfExists(String) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, POSTGRES }) public static DropSequenceFinalStep dropSequenceIfExists(String sequence) { return using(new DefaultConfiguration()).dropSequenceIfExists(sequence); } /** * Create a new DSL DROP SEQUENCE IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropSequenceIfExists(Name) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, POSTGRES }) public static DropSequenceFinalStep dropSequenceIfExists(Name sequence) { return using(new DefaultConfiguration()).dropSequenceIfExists(sequence); } /** * Create a new DSL DROP SEQUENCE IF EXISTS statement. *

* If your database doesn't natively support IF EXISTS, this is * emulated by catching (and ignoring) the relevant {@link SQLException}. * * @see DSLContext#dropSequenceIfExists(Sequence) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, POSTGRES }) public static DropSequenceFinalStep dropSequenceIfExists(Sequence sequence) { return using(new DefaultConfiguration()).dropSequenceIfExists(sequence); } /** * Create a new DSL truncate statement. *

* Unlike {@link Delete} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * DELETE statement. *

* Example: *

*

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * truncate(table);
     * 
*

Simulation of TRUNCATE

*

* Most dialects implement the TRUNCATE statement. If it is not * supported, it is emulated using an equivalent DELETE * statement. This is particularly true for these dialects: *

    *
  • {@link SQLDialect#FIREBIRD}
  • *
  • {@link SQLDialect#INGRES}
  • *
  • {@link SQLDialect#SQLITE}
  • *
*

Vendor-specific extensions of TRUNCATE

*

* Some statements also support extensions of the TRUNCATE * statement, such as Postgres: *

*

     * truncate(table)
     *   .restartIdentity()
     *   .cascade()
     * 
*

* These vendor-specific extensions are currently not emulated for those * dialects that do not support them natively. * * @see DSLContext#truncate(Name) */ @Support public static TruncateIdentityStep truncate(Name table) { return using(new DefaultConfiguration()).truncate(table); } /** * Create a new DSL truncate statement. *

* Unlike {@link Delete} factory methods in the {@link DSLContext} API, this * creates an unattached, and thus not directly renderable or executable * DELETE statement. *

* Example: *

*

     * import static org.jooq.impl.DSL.*;
     *
     * // [...]
     *
     * truncate(table);
     * 
*

Simulation of TRUNCATE

*

* Most dialects implement the TRUNCATE statement. If it is not * supported, it is emulated using an equivalent DELETE * statement. This is particularly true for these dialects: *

    *
  • {@link SQLDialect#FIREBIRD}
  • *
  • {@link SQLDialect#INGRES}
  • *
  • {@link SQLDialect#SQLITE}
  • *
*

Vendor-specific extensions of TRUNCATE

*

* Some statements also support extensions of the TRUNCATE * statement, such as Postgres: *

*

     * truncate(table)
     *   .restartIdentity()
     *   .cascade()
     * 
*

* These vendor-specific extensions are currently not emulated for those * dialects that do not support them natively. * * @see DSLContext#truncate(Table) */ @Support public static TruncateIdentityStep truncate(Table table) { return using(new DefaultConfiguration()).truncate(table); } // ------------------------------------------------------------------------- // XXX Quantified comparison predicate expressions // ------------------------------------------------------------------------- /** * Create an ALL quantified select to be used in quantified * comparison predicate expressions. * * @see Field#equal(QuantifiedSelect) * @see Field#notEqual(QuantifiedSelect) * @see Field#greaterThan(QuantifiedSelect) * @see Field#greaterOrEqual(QuantifiedSelect) * @see Field#lessThan(QuantifiedSelect) * @see Field#lessOrEqual(QuantifiedSelect) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static QuantifiedSelect all(Select select) { return new QuantifiedSelectImpl(Quantifier.ALL, select); } /** * Create an ALL quantified select to be used in quantified * comparison predicate expressions. *

* This is natively supported by {@link SQLDialect#POSTGRES}. Other dialects * will render a subselect unnesting the array. * * @see Field#equal(QuantifiedSelect) * @see Field#notEqual(QuantifiedSelect) * @see Field#greaterThan(QuantifiedSelect) * @see Field#greaterOrEqual(QuantifiedSelect) * @see Field#lessThan(QuantifiedSelect) * @see Field#lessOrEqual(QuantifiedSelect) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static QuantifiedSelect> all(T... array) { return all(val(array)); } /** * Create an ALL quantified select to be used in quantified * comparison predicate expressions. *

* This is natively supported by {@link SQLDialect#POSTGRES}. Other dialects * will render a subselect unnesting the array. * * @see Field#equal(QuantifiedSelect) * @see Field#notEqual(QuantifiedSelect) * @see Field#greaterThan(QuantifiedSelect) * @see Field#greaterOrEqual(QuantifiedSelect) * @see Field#lessThan(QuantifiedSelect) * @see Field#lessOrEqual(QuantifiedSelect) */ @Support({ H2, HSQLDB, POSTGRES }) public static QuantifiedSelect> all(Field array) { return new QuantifiedSelectImpl>(Quantifier.ALL, array); } /** * Create an ANY quantified select to be used in quantified * comparison predicate expressions. * * @see Field#equal(QuantifiedSelect) * @see Field#notEqual(QuantifiedSelect) * @see Field#greaterThan(QuantifiedSelect) * @see Field#greaterOrEqual(QuantifiedSelect) * @see Field#lessThan(QuantifiedSelect) * @see Field#lessOrEqual(QuantifiedSelect) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static QuantifiedSelect any(Select select) { return new QuantifiedSelectImpl(Quantifier.ANY, select); } /** * Create an ANY quantified select to be used in quantified * comparison predicate expressions. *

* This is natively supported by {@link SQLDialect#POSTGRES}. Other dialects * will render a subselect unnesting the array. * * @see Field#equal(QuantifiedSelect) * @see Field#notEqual(QuantifiedSelect) * @see Field#greaterThan(QuantifiedSelect) * @see Field#greaterOrEqual(QuantifiedSelect) * @see Field#lessThan(QuantifiedSelect) * @see Field#lessOrEqual(QuantifiedSelect) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static QuantifiedSelect> any(T... array) { return any(val(array)); } /** * Create an ANY quantified select to be used in quantified * comparison predicate expressions. *

* This is natively supported by {@link SQLDialect#POSTGRES}. Other dialects * will render a subselect unnesting the array. * * @see Field#equal(QuantifiedSelect) * @see Field#notEqual(QuantifiedSelect) * @see Field#greaterThan(QuantifiedSelect) * @see Field#greaterOrEqual(QuantifiedSelect) * @see Field#lessThan(QuantifiedSelect) * @see Field#lessOrEqual(QuantifiedSelect) */ @Support({ H2, HSQLDB, POSTGRES }) public static QuantifiedSelect> any(Field array) { return new QuantifiedSelectImpl>(Quantifier.ANY, array); } // ------------------------------------------------------------------------- // XXX Conversion of objects into tables // ------------------------------------------------------------------------- /** * A synonym for {@link Select#asTable()}, which might look a bit more fluent * like this, to some users. * * @see Select#asTable() */ @Support public static Table table(Select select) { return select.asTable(); } /** * Use a previously obtained result as a new {@link Table} that can be used * in SQL statements through {@link #values(RowN...)}. * * @see #values(RowN...) */ @Support public static Table table(Result result) { int size = result.size(); RowN[] rows = new RowN[size]; for (int i = 0; i < size; i++) rows[i] = (RowN) result.get(i).valuesRow(); Field[] fields = result.fields(); String[] columns = new String[fields.length]; for (int i = 0; i < fields.length; i++) columns[i] = fields[i].getName(); // TODO [#2986] Coerce the record type upon the resulting table. return (Table) values(rows).as("v", columns); } /** * Use a previously obtained record as a new Table */ @Support public static Table table(R record) { return table((R[]) new Record[] { record }); } /** * Use a previously obtained set of records as a new Table */ @Support public static Table table(R... records) { if (records == null || records.length == 0) return (Table) new Dual(); Result result = new ResultImpl(configuration(records[0]), records[0].fields()); result.addAll(Arrays.asList(records)); return table(result); } /** * A synonym for {@link #unnest(List)}. * * @see #unnest(List) */ @Support public static Table table(List list) { return table(list.toArray()); } /** * A synonym for {@link #unnest(Object[])}. * * @see #unnest(Object[]) */ @Support public static Table table(Object[] array) { return table(val(array)); } /** * A synonym for {@link #unnest(Field)}. * * @see #unnest(Field) */ @Support({ H2, HSQLDB, POSTGRES }) public static Table table(Field cursor) { return unnest(cursor); } /** * Create a table from a list of values. *

* This is equivalent to the TABLE function for H2, or the * UNNEST function in HSQLDB and Postgres *

* For Oracle, use {@link #table(ArrayRecord)} instead, as Oracle knows only * typed arrays *

* In all other dialects, unnesting of arrays is emulated using several * UNION ALL connected subqueries. */ @Support public static Table unnest(List list) { return unnest(list.toArray()); } /** * Create a table from an array of values. *

* This is equivalent to the TABLE function for H2, or the * UNNEST function in HSQLDB and Postgres *

* For Oracle, use {@link #table(ArrayRecord)} instead, as Oracle knows only * typed arrays *

* In all other dialects, unnesting of arrays is emulated using several * UNION ALL connected subqueries. */ @Support public static Table unnest(Object[] array) { return unnest(val(array)); } /** * Create a table from a field. *

* The supplied field can have any of these types: *

    *
  • {@link Result}: For CURSOR or REF CURSOR * fields, typically fetched from stored functions or from nested tables
  • *
  • {@link ArrayRecord}: For Oracle-style VARRAY types.
  • *
  • {@link Object}[]: Array types, for other RDBMS's ARRAY types (e.g. * H2, HSQLDB, and Postgres)
  • *
  • {@link Object}: Any other type that jOOQ will try to convert in an * array first, before converting that array into a table
  • *
*

* This functionality has only limited scope when used in H2, as ARRAY types * involved with stored functions can only be of type Object[]. * Such arrays are converted into VARCHAR arrays by jOOQ. *

* In all dialects where arrays are not supported, unnesting of arrays is * emulated using several UNION ALL connected subqueries. */ @Support({ H2, HSQLDB, POSTGRES }) public static Table unnest(Field cursor) { if (cursor == null) { throw new IllegalArgumentException(); } // The field is an actual CURSOR or REF CURSOR returned from a stored // procedure or from a NESTED TABLE else if (cursor.getType() == Result.class) { return new org.jooq.impl.FunctionTable(cursor); } // The field is a regular array else if (cursor.getType().isArray() && cursor.getType() != byte[].class) { return new ArrayTable(cursor); } // The field has any other type. Try to make it an array throw new SQLDialectNotSupportedException("Converting arbitrary types into array tables is currently not supported"); } // ------------------------------------------------------------------------- // XXX Table functions // ------------------------------------------------------------------------- /** * The DUAL table to be used for syntactic completeness. *

* In general, jOOQ will generate a DUAL table (or any * equivalent construct, see below), if this is needed syntactically in * generated SQL. You may still wish to explicitly use a DUAL * construct in jOOQ code for various reasons. This DUAL table * will always contain a single record with a single varchar(1) value: *

     * +-------+
     * | DUMMY |
     * +-------+
     * | X     |
     * +-------+
     * 
*/ @Support public static Table dual() { return new Dual(true); } /** * A table function generating a series of values from from to * to (inclusive). *

* This function is inspired by PostgreSQL's * GENERATE_SERIES(from, to) function. Other SQL dialects may * be capable of emulating this behaviour, e.g. Oracle:

     * -- PostgreSQL
     * SELECT * FROM GENERATE_SERIES(a, b)
     *
     * -- Oracle
     * SELECT * FROM (SELECT a + LEVEL - 1 FROM DUAL CONNECT BY a + LEVEL - 1 <= b)
     * 
*/ @Support({ CUBRID, POSTGRES }) public static Table> generateSeries(int from, int to) { return generateSeries(val(from), val(to)); } /** * A table function generating a series of values from from to * to (inclusive). *

* This function is inspired by PostgreSQL's * GENERATE_SERIES(from, to) function. Other SQL dialects may * be capable of emulating this behaviour, e.g. Oracle:

     * -- PostgreSQL
     * SELECT * FROM GENERATE_SERIES(a, b)
     *
     * -- Oracle
     * SELECT * FROM (SELECT a + LEVEL - 1 FROM DUAL CONNECT BY a + LEVEL - 1 <= b)
     * 
*/ @Support({ CUBRID, POSTGRES }) public static Table> generateSeries(int from, Field to) { return generateSeries(val(from), nullSafe(to)); } /** * A table function generating a series of values from from to * to (inclusive). *

* This function is inspired by PostgreSQL's * GENERATE_SERIES(from, to) function. Other SQL dialects may * be capable of emulating this behaviour, e.g. Oracle:

     * -- PostgreSQL
     * SELECT * FROM GENERATE_SERIES(a, b)
     *
     * -- Oracle
     * SELECT * FROM (SELECT a + LEVEL - 1 FROM DUAL CONNECT BY a + LEVEL - 1 <= b)
     * 
*/ @Support({ CUBRID, POSTGRES }) public static Table> generateSeries(Field from, int to) { return new GenerateSeries(nullSafe(from), val(to)); } /** * A table function generating a series of values from from to * to (inclusive). *

* This function is inspired by PostgreSQL's * GENERATE_SERIES(from, to) function. Other SQL dialects may * be capable of emulating this behaviour, e.g. Oracle:

     * -- PostgreSQL
     * SELECT * FROM GENERATE_SERIES(a, b)
     *
     * -- Oracle
     * SELECT * FROM (SELECT a + LEVEL - 1 FROM DUAL CONNECT BY a + LEVEL - 1 <= b)
     * 
*/ @Support({ CUBRID, POSTGRES }) public static Table> generateSeries(Field from, Field to) { return new GenerateSeries(nullSafe(from), nullSafe(to)); } /** * Create a LATERAL joined table. *

* Example: *

     * SELECT *
     * FROM employees e,
     *      LATERAL(SELECT * FROM departments d
     *              WHERE e.department_id = d.department_id);
     * 
*/ @Support({ POSTGRES_9_3 }) public static Table lateral(TableLike table) { return new Lateral(table.asTable()); } /** * Create a ROWS FROM (tables...) expression. *

* Example:

     * SELECT *
     * FROM ROWS FROM (function1('a', 'b'), function2('c', 'd'));
     * 
*

* This allows for full outer joining several table-valued functions on the * row number of each function's produced rows. */ @Support(POSTGRES) public static Table rowsFrom(Table... tables) { return new RowsFrom(tables); } // ------------------------------------------------------------------------- // XXX SQL keywords // ------------------------------------------------------------------------- /** * Create a SQL keyword. *

* A Keyword is a {@link QueryPart} that renders a SQL keyword * according to the settings specified in * {@link Settings#getRenderKeywordStyle()}. It can be embedded in other * plain SQL QueryParts as shown in this example: *

*

     * Condition c = condition("{0} {1} {2} {3} {4}",
     *     value1, keyword("between")
     *     value2, keyword("and")
     *     value3
     * );
     * 
*/ public static Keyword keyword(String keyword) { return new KeywordImpl(keyword); } // ------------------------------------------------------------------------- // XXX Names // ------------------------------------------------------------------------- /** * Create a new SQL identifier using a qualified name. *

* Use this method to construct syntax-safe, SQL-injection-safe SQL * identifiers for use in plain SQL where {@link QueryPart} objects are * accepted. For instance, this can be used with any of these methods: *

    *
  • {@link #field(String, QueryPart...)}
  • *
  • {@link #field(String, Class, QueryPart...)}
  • *
  • {@link #field(String, DataType, QueryPart...)}
  • *
*

* An example:

     * // This qualified name here
     * name("book", "title");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [book].[title]
     * 
* * @param qualifiedName The SQL identifier's qualified name parts * @return A {@link QueryPart} that will render the SQL identifier */ public static Name name(String... qualifiedName) { return new NameImpl(qualifiedName); } /** * Create a new SQL identifier using a qualified name. *

* Use this method to construct syntax-safe, SQL-injection-safe SQL * identifiers for use in plain SQL where {@link QueryPart} objects are * accepted. For instance, this can be used with any of these methods: *

    *
  • {@link #field(String, QueryPart...)}
  • *
  • {@link #field(String, Class, QueryPart...)}
  • *
  • {@link #field(String, DataType, QueryPart...)}
  • *
*

* An example:

     * // This qualified name here
     * name("book", "title");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [book].[title]
     * 
* * @param qualifiedName The SQL identifier's qualified name parts * @return A {@link QueryPart} that will render the SQL identifier */ public static Name name(Collection qualifiedName) { return new NameImpl(qualifiedName.toArray(Tools.EMPTY_STRING)); } // ------------------------------------------------------------------------- // XXX QueryPart composition // ------------------------------------------------------------------------- /** * Compose a list of QueryParts into a new * QueryPart, with individual parts being comma-separated. */ public static QueryPart list(QueryPart... parts) { return list(Arrays.asList(parts)); } /** * Compose a list of QueryParts into a new * QueryPart, with individual parts being comma-separated. */ public static QueryPart list(Collection parts) { return new QueryPartList(parts); } // ------------------------------------------------------------------------- // XXX SQL identifiers // ------------------------------------------------------------------------- /** * Create a DEFAULT keyword for use with INSERT, * UPDATE, or MERGE statements. *

* While the DEFAULT keyword works with all data types, you may * still prefer to associate a {@link Field} type with your * DEFAULT value. In that case, use * {@link #defaultValue(Class)} or {@link #defaultValue(DataType)} instead. */ @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field defaultValue() { return defaultValue(Object.class); } /** * Create a DEFAULT keyword for use with INSERT, * UPDATE, or MERGE statements. */ @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field defaultValue(Class type) { return defaultValue(getDataType(type)); } /** * Create a DEFAULT keyword for use with INSERT, * UPDATE, or MERGE statements. */ @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field defaultValue(DataType type) { return new SQLField(type, keyword("default")); } /** * Create a DEFAULT keyword for use with INSERT, * UPDATE, or MERGE statements. */ @Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field defaultValue(Field field) { return new SQLField(field.getDataType(), keyword("default")); } /** * Create a qualified schema, given its schema name. *

* This constructs a schema reference given the schema's qualified name. * jOOQ will render the schema name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This schema...
     * schemaByName("MY_SCHEMA");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA]
     * 
* * @param name The schema's reference name. * @return A schema referenced by name * @deprecated - [#3843] - 3.6.0 - use {@link #schema(Name)} instead */ @Deprecated @Support public static Schema schemaByName(String name) { return new SchemaImpl(name); } /** * Create a qualified catalog, given its catalog name. *

* This constructs a catalog reference given the catalog's qualified name. * jOOQ will render the catalog name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This catalog...
     * catalog(name("MY_CATALOG"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_CATALOG]
     * 
*/ @Support public static Catalog catalog(Name name) { return new CatalogImpl(name); } /** * Create a qualified schema, given its schema name. *

* This constructs a schema reference given the schema's qualified name. * jOOQ will render the schema name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This schema...
     * schema(name("MY_CATALOG", "MY_SCHEMA"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_CATALOG].[MY_SCHEMA]
     * 
*/ @Support public static Schema schema(Name name) { return new SchemaImpl(name); } /** * Create a qualified sequence, given its sequence name. *

* This constructs a sequence reference given the sequence's qualified name. * jOOQ will render the sequence name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This sequence...
     * sequenceByName("MY_SCHEMA", "MY_SEQUENCE");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_SEQUENCE]
     * 
* * @param qualifiedName The various parts making up your sequence's * reference name. * @return A sequence referenced by sequenceName * @deprecated - [#3843] - 3.6.0 - use {@link #sequence(Name)} instead */ @Deprecated @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static Sequence sequenceByName(String... qualifiedName) { return sequenceByName(BigInteger.class, qualifiedName); } /** * Create a qualified sequence, given its sequence name. *

* This constructs a sequence reference given the sequence's qualified name. * jOOQ will render the sequence name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This sequence...
     * sequenceByName("MY_SCHEMA", "MY_SEQUENCE");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_SEQUENCE]
     * 
* * @param qualifiedName The various parts making up your sequence's * reference name. * @param type The type of the returned field * @return A sequence referenced by sequenceName * @deprecated - [#3843] - 3.6.0 - use {@link #sequence(Name, Class)} instead */ @Deprecated @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static Sequence sequenceByName(Class type, String... qualifiedName) { return sequenceByName(getDataType(type), qualifiedName); } /** * Create a qualified sequence, given its sequence name. *

* This constructs a sequence reference given the sequence's qualified name. * jOOQ will render the sequence name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This sequence...
     * sequenceByName("MY_SCHEMA", "MY_SEQUENCE");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_SEQUENCE]
     * 
* * @param qualifiedName The various parts making up your sequence's * reference name. * @param type The type of the returned field * @return A sequence referenced by sequenceName * @deprecated - [#3843] - 3.6.0 - use {@link #sequence(Name, DataType)} instead */ @Deprecated @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static Sequence sequenceByName(DataType type, String... qualifiedName) { if (qualifiedName == null) throw new NullPointerException(); if (qualifiedName.length < 1 || qualifiedName.length > 2) throw new IllegalArgumentException("Must provide a qualified name of length 1 or 2 : " + name(qualifiedName)); String name = qualifiedName[qualifiedName.length - 1]; Schema schema = qualifiedName.length == 2 ? schemaByName(qualifiedName[0]) : null; return new SequenceImpl(name, schema, type); } /** * Create a qualified sequence, given its sequence name. *

* This constructs a sequence reference given the sequence's qualified name. * jOOQ will render the sequence name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This sequence...
     * sequence(name("MY_SCHEMA", "MY_SEQUENCE"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_SEQUENCE]
     * 
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static Sequence sequence(Name name) { return sequence(name, BigInteger.class); } /** * Create a qualified sequence, given its sequence name. *

* This constructs a sequence reference given the sequence's qualified name. * jOOQ will render the sequence name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This sequence...
     * sequence(name("MY_SCHEMA", "MY_SEQUENCE"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_SEQUENCE]
     * 
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static Sequence sequence(Name name, Class type) { return sequence(name, getDataType(type)); } /** * Create a qualified sequence, given its sequence name. *

* This constructs a sequence reference given the sequence's qualified name. * jOOQ will render the sequence name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This sequence...
     * sequence(name("MY_SCHEMA", "MY_SEQUENCE"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_SEQUENCE]
     * 
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) public static Sequence sequence(Name name, DataType type) { if (name == null) throw new NullPointerException(); if (name.getName().length < 1 || name.getName().length > 2) throw new IllegalArgumentException("Must provide a qualified name of length 1 or 2 : " + name); String n = name.getName()[name.getName().length - 1]; Schema s = name.getName().length == 2 ? schema(name(name.getName()[0])) : null; return new SequenceImpl(n, s, type); } /** * Create a qualified table, given its table name. *

* This constructs a table reference given the table's qualified name. jOOQ * will render the table name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This table...
     * tableByName("MY_SCHEMA", "MY_TABLE");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE]
     * 
* * @param qualifiedName The various parts making up your table's reference * name. * @return A table referenced by tableName * @deprecated - [#3843] - 3.6.0 - use {@link #table(Name)} instead */ @Deprecated @Support public static Table tableByName(String... qualifiedName) { return table(name(qualifiedName)); } /** * Create a qualified table, given its table name. *

* This constructs a table reference given the table's qualified name. jOOQ * will render the table name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This table...
     * tableByName("MY_SCHEMA", "MY_TABLE");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE]
     * 
*/ @Support public static Table table(Name name) { return new QualifiedTable(name); } /** * Create a qualified field, given its (qualified) field name. *

* This constructs a field reference given the field's qualified name. jOOQ * will render the field name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This field...
     * fieldByName("MY_SCHEMA", "MY_TABLE", "MY_FIELD");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE].[MY_FIELD]
     * 
*

* Another example:

     * create.select(field("length({1})", Integer.class, fieldByName("TITLE")))
     *       .from(tableByName("T_BOOK"))
     *       .fetch();
     *
     * // ... will execute this SQL on SQL Server:
     * select length([TITLE]) from [T_BOOK]
     * 
* * @param qualifiedName The various parts making up your field's reference * name. * @return A field referenced by fieldName * @deprecated - [#3843] - 3.6.0 - use {@link #field(Name)} instead */ @Deprecated @Support public static Field fieldByName(String... qualifiedName) { return fieldByName(Object.class, qualifiedName); } /** * Create a qualified field, given its (qualified) field name. *

* This constructs a field reference given the field's qualified name. jOOQ * will render the field name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This field...
     * fieldByName("MY_SCHEMA", "MY_TABLE", "MY_FIELD");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE].[MY_FIELD]
     * 
*

* Another example:

     * create.select(field("length({1})", Integer.class, fieldByName("TITLE")))
     *       .from(tableByName("T_BOOK"))
     *       .fetch();
     *
     * // ... will execute this SQL on SQL Server:
     * select length([TITLE]) from [T_BOOK]
     * 
* * @param qualifiedName The various parts making up your field's reference * name. * @param type The type of the returned field * @return A field referenced by fieldName * @deprecated - [#3843] - 3.6.0 - use {@link #field(Name, Class)} instead */ @Deprecated @Support public static Field fieldByName(Class type, String... qualifiedName) { return fieldByName(getDataType(type), qualifiedName); } /** * Create a qualified field, given its (qualified) field name. *

* This constructs a field reference given the field's qualified name. jOOQ * will render the field name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This field...
     * fieldByName("MY_SCHEMA", "MY_TABLE", "MY_FIELD");
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE].[MY_FIELD]
     * 
*

* Another example:

     * create.select(field("length({1})", Integer.class, fieldByName("TITLE")))
     *       .from(tableByName("T_BOOK"))
     *       .fetch();
     *
     * // ... will execute this SQL on SQL Server:
     * select length([TITLE]) from [T_BOOK]
     * 
* * @param qualifiedName The various parts making up your field's reference * name. * @param type The type of the returned field * @return A field referenced by fieldName * @deprecated - [#3843] - 3.6.0 - use {@link #field(Name, DataType)} instead */ @Deprecated @Support public static Field fieldByName(DataType type, String... qualifiedName) { return field(name(qualifiedName), type); } /** * Create a qualified field, given its (qualified) field name. *

* This constructs a field reference given the field's qualified name. jOOQ * will render the field name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This field...
     * field(name("MY_SCHEMA", "MY_TABLE", "MY_FIELD"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE].[MY_FIELD]
     * 
*

* Another example:

     * create.select(field("length({1})", Integer.class, field(name("TITLE"))))
     *       .from(table(name("T_BOOK")))
     *       .fetch();
     *
     * // ... will execute this SQL on SQL Server:
     * select length([TITLE]) from [T_BOOK]
     * 
*/ @Support public static Field field(Name name) { return field(name, Object.class); } /** * Create a qualified field, given its (qualified) field name. *

* This constructs a field reference given the field's qualified name. jOOQ * will render the field name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This field...
     * field(name("MY_SCHEMA", "MY_TABLE", "MY_FIELD"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE].[MY_FIELD]
     * 
*

* Another example:

     * create.select(field("length({1})", Integer.class, field(name("TITLE"))))
     *       .from(table(name("T_BOOK")))
     *       .fetch();
     *
     * // ... will execute this SQL on SQL Server:
     * select length([TITLE]) from [T_BOOK]
     * 
*/ @Support public static Field field(Name name, Class type) { return field(name, getDataType(type)); } /** * Create a qualified field, given its (qualified) field name. *

* This constructs a field reference given the field's qualified name. jOOQ * will render the field name according to your * {@link Settings#getRenderNameStyle()} settings. Choose * {@link RenderNameStyle#QUOTED} to prevent syntax errors and/or SQL * injection. *

* Example:

     * // This field...
     * field(name("MY_SCHEMA", "MY_TABLE", "MY_FIELD"));
     *
     * // ... will render this SQL on SQL Server with RenderNameStyle.QUOTED set
     * [MY_SCHEMA].[MY_TABLE].[MY_FIELD]
     * 
*

* Another example:

     * create.select(field("length({1})", Integer.class, field(name("TITLE"))))
     *       .from(table(name("T_BOOK")))
     *       .fetch();
     *
     * // ... will execute this SQL on SQL Server:
     * select length([TITLE]) from [T_BOOK]
     * 
*/ @Support public static Field field(Name name, DataType type) { return new QualifiedField(name, type); } // ------------------------------------------------------------------------- // XXX: Queries // ------------------------------------------------------------------------- /** * Wrap a collection of queries. */ @Support public static Queries queries(Query... queries) { return queries(Arrays.asList(queries)); } /** * Wrap a collection of queries. */ @Support public static Queries queries(Collection queries) { return new QueriesImpl(queries); } // ------------------------------------------------------------------------- // XXX Plain SQL object factory // ------------------------------------------------------------------------- /** * A custom SQL clause that can render arbitrary expressions. *

* A plain SQL QueryPart is a QueryPart that can * contain user-defined plain SQL, because sometimes it is easier to express * things directly in SQL. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A query part wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static SQL sql(String sql) { return sql(sql, new Object[0]); } /** * A custom SQL clause that can render arbitrary expressions. *

* A plain SQL QueryPart is a QueryPart that can * contain user-defined plain SQL, because sometimes it is easier to express * things directly in SQL. *

* This overload takes a set of {@link QueryPart} arguments which are * replaced into the SQL string template at the appropriate index. Example: *

*

     * // Argument QueryParts are replaced into the SQL string at the appropriate index
     * sql("select {0}, {1} from {2}", TABLE.COL1, TABLE.COL2, TABLE);
     *
     * // Bind variables are supported as well, for backwards compatibility
     * sql("select col1, col2 from table where col1 = ?", val(1));
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A query part wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static SQL sql(String sql, QueryPart... parts) { return sql(sql, (Object[]) parts); } /** * A custom SQL clause that can render arbitrary expressions. *

* A plain SQL QueryPart is a QueryPart that can * contain user-defined plain SQL, because sometimes it is easier to express * things directly in SQL. There must be as many binding variables contained * in the SQL, as passed in the bindings parameter *

* This overload takes a set of bind value arguments which are replaced our * bound into the SQL string template at the appropriate index. Example: *

*

     * sql("select col1, col2 from table where col1 = ?", 1);
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A query part wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static SQL sql(String sql, Object... bindings) { return new SQLImpl(sql, bindings); } /** * A custom SQL clause that can render arbitrary expressions. *

* A plain SQL QueryPart is a QueryPart that can * contain user-defined plain SQL, because sometimes it is easier to express * things directly in SQL. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A query part wrapping the plain SQL * @deprecated - 3.6.0 - [#3854] - Use {@link #sql(String)} instead * @see SQL */ @Deprecated @Support @PlainSQL public static QueryPart queryPart(String sql) { return sql(sql); } /** * A custom SQL clause that can render arbitrary expressions. *

* A plain SQL QueryPart is a QueryPart that can * contain user-defined plain SQL, because sometimes it is easier to express * things directly in SQL. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A query part wrapping the plain SQL * @deprecated - 3.6.0 - [#3854] - Use {@link #sql(String, QueryPart...)} instead * @see SQL * @see DSL#sql(String, QueryPart...) */ @Deprecated @Support @PlainSQL public static QueryPart queryPart(String sql, QueryPart... parts) { return sql(sql, parts); } /** * A custom SQL clause that can render arbitrary expressions. *

* A plain SQL QueryPart is a QueryPart that can * contain user-defined plain SQL, because sometimes it is easier to express * things directly in SQL. There must be as many binding variables contained * in the SQL, as passed in the bindings parameter *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A query part wrapping the plain SQL * @deprecated - 3.6.0 - [#3854] - Use {@link #sql(String, Object...)} instead * @see SQL * @see DSL#sql(String, Object...) */ @Deprecated @Support @PlainSQL public static QueryPart queryPart(String sql, Object... bindings) { return sql(sql, bindings); } // ------------------------------------------------------------------------- // XXX Plain SQL API // ------------------------------------------------------------------------- /** * Create a new query holding plain SQL. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "SET SCHEMA 'abc'";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A query wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Query query(SQL sql) { return using(new DefaultConfiguration()).query(sql); } /** * Create a new query holding plain SQL. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "SET SCHEMA 'abc'";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A query wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Query query(String sql) { return using(new DefaultConfiguration()).query(sql); } /** * Create a new query holding plain SQL. There must be as many bind * variables contained in the SQL, as passed in the bindings parameter. *

* Example: *

*

     * String sql = "SET SCHEMA 'abc'";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param bindings The bindings * @return A query wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static Query query(String sql, Object... bindings) { return using(new DefaultConfiguration()).query(sql, bindings); } /** * Create a new query holding plain SQL. *

* Unlike {@link #query(String, Object...)}, the SQL passed to this method * should not contain any bind variables. Instead, you can pass * {@link QueryPart} objects to the method which will be rendered at indexed * locations of your SQL string as such:

     * // The following query
     * query("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
     *
     * // Will render this SQL on an Oracle database with RenderNameStyle.QUOTED:
     * select ?, 'test' from "DUAL"
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! One way to escape * literals is to use {@link DSL#name(String...)} and similar methods * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A query wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static Query query(String sql, QueryPart... parts) { return using(new DefaultConfiguration()).query(sql, parts); } /** * Create a new query holding plain SQL. *

* There must not be any binding variables contained in the SQL *

* Use this method, when you want to take advantage of the many ways to * fetch results in jOOQ, using {@link ResultQuery}. Some examples: *

*

* * * * * * * * * * * * *
{@link ResultQuery#fetchLazy()}Open a cursor and fetch records one by one
{@link ResultQuery#fetchInto(Class)}Fetch records into a custom POJO (optionally annotated with JPA * annotations)
{@link ResultQuery#fetchInto(RecordHandler)}Fetch records into a custom callback (similar to Spring's RowMapper)
*

* Example (Postgres): *

*

     * String sql = "FETCH ALL IN \"\"";
Example * (SQLite): *

*

     * String sql = "pragma table_info('my_table')";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return An executable query * @see SQL */ @Support @PlainSQL public static ResultQuery resultQuery(SQL sql) { return using(new DefaultConfiguration()).resultQuery(sql); } /** * Create a new query holding plain SQL. *

* There must not be any binding variables contained in the SQL *

* Use this method, when you want to take advantage of the many ways to * fetch results in jOOQ, using {@link ResultQuery}. Some examples: *

*

* * * * * * * * * * * * *
{@link ResultQuery#fetchLazy()}Open a cursor and fetch records one by one
{@link ResultQuery#fetchInto(Class)}Fetch records into a custom POJO (optionally annotated with JPA * annotations)
{@link ResultQuery#fetchInto(RecordHandler)}Fetch records into a custom callback (similar to Spring's RowMapper)
*

* Example (Postgres): *

*

     * String sql = "FETCH ALL IN \"\"";
Example * (SQLite): *

*

     * String sql = "pragma table_info('my_table')";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return An executable query * @see SQL */ @Support @PlainSQL public static ResultQuery resultQuery(String sql) { return using(new DefaultConfiguration()).resultQuery(sql); } /** * Create a new query holding plain SQL. *

* There must be as many bind variables contained in the SQL, as passed in * the bindings parameter *

* Use this method, when you want to take advantage of the many ways to * fetch results in jOOQ, using {@link ResultQuery}. Some examples: *

*

* * * * * * * * * * * * *
{@link ResultQuery#fetchLazy()}Open a cursor and fetch records one by one
{@link ResultQuery#fetchInto(Class)}Fetch records into a custom POJO (optionally annotated with JPA * annotations)
{@link ResultQuery#fetchInto(RecordHandler)}Fetch records into a custom callback (similar to Spring's RowMapper)
*

* Example (Postgres): *

*

     * String sql = "FETCH ALL IN \"\"";
Example * (SQLite): *

*

     * String sql = "pragma table_info('my_table')";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param bindings The bindings * @return A query wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static ResultQuery resultQuery(String sql, Object... bindings) { return using(new DefaultConfiguration()).resultQuery(sql, bindings); } /** * Create a new query holding plain SQL. *

* Unlike {@link #resultQuery(String, Object...)}, the SQL passed to this * method should not contain any bind variables. Instead, you can pass * {@link QueryPart} objects to the method which will be rendered at indexed * locations of your SQL string as such:

     * // The following query
     * resultQuery("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
     *
     * // Will render this SQL on an Oracle database with RenderNameStyle.QUOTED:
     * select ?, 'test' from "DUAL"
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! One way to escape * literals is to use {@link DSL#name(String...)} and similar methods * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A query wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static ResultQuery resultQuery(String sql, QueryPart... parts) { return using(new DefaultConfiguration()).resultQuery(sql, parts); } /** * A custom SQL clause that can render arbitrary table expressions. *

* A plain SQL table is a table that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex, but static subqueries or tables from different schemas. *

* Example *

*

     * String sql = "SELECT * FROM USER_TABLES WHERE OWNER = 'MY_SCHEMA'";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A table wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Table table(SQL sql) { return new SQLTable(sql); } /** * A custom SQL clause that can render arbitrary table expressions. *

* A plain SQL table is a table that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex, but static subqueries or tables from different schemas. *

* Example *

*

     * String sql = "SELECT * FROM USER_TABLES WHERE OWNER = 'MY_SCHEMA'";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A table wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Table table(String sql) { return table(sql, new Object[0]); } /** * A custom SQL clause that can render arbitrary table expressions. *

* A plain SQL table is a table that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex, but static subqueries or tables from different schemas. * There must be as many binding variables contained in the SQL, as passed * in the bindings parameter *

* Example *

*

     * String sql = "SELECT * FROM USER_TABLES WHERE OWNER = ?";
     * Object[] bindings = new Object[] { "MY_SCHEMA" };
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A table wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static Table table(String sql, Object... bindings) { return table(sql(sql, bindings)); } /** * A custom SQL clause that can render arbitrary table expressions. *

* A plain SQL table is a table that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex, but static subqueries or tables from different schemas. *

* Example *

*

     * String sql = "SELECT * FROM USER_TABLES WHERE {0}";
     * QueryPart[] parts = new QueryPart[] { USER_TABLES.OWNER.equal("MY_SCHEMA") };
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A table wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static Table table(String sql, QueryPart... parts) { return table(sql, (Object[]) parts); } /** * Create a "plain SQL" sequence. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A field wrapping the plain SQL * @see SQL */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) @PlainSQL public static Sequence sequence(String sql) { return sequence(sql, BigInteger.class); } /** * Create a "plain SQL" sequence. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @return A field wrapping the plain SQL * @see SQL */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) @PlainSQL public static Sequence sequence(String sql, Class type) { return sequence(sql, getDataType(type)); } /** * Create a "plain SQL" sequence. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @return A field wrapping the plain SQL * @see SQL */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) @PlainSQL public static Sequence sequence(String sql, DataType type) { return new SequenceImpl(sql, null, type, true); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, 1, 100, 200)";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A field wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Field field(SQL sql) { return field(sql, Object.class); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, 1, 100, 200)";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A field wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Field field(String sql) { return field(sql, new Object[0]); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must be as many binding * variables contained in the SQL, as passed in the bindings parameter *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, ?, ?, ?)";
     * Object[] bindings = new Object[] { 1, 100, 200 };
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param bindings The bindings for the field * @return A field wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static Field field(String sql, Object... bindings) { return field(sql, Object.class, bindings); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, 1, 100, 200)";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @return A field wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Field field(SQL sql, Class type) { return field(sql, getDataType(type)); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, 1, 100, 200)";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @return A field wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Field field(String sql, Class type) { return field(sql, type, new Object[0]); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must be as many binding * variables contained in the SQL, as passed in the bindings parameter *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, ?, ?, ?)";
     * Object[] bindings = new Object[] { 1, 100, 200 };
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @param bindings The bindings for the field * @return A field wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static Field field(String sql, Class type, Object... bindings) { return field(sql, getDataType(type), bindings); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, 1, 100, 200)";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @return A field wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Field field(SQL sql, DataType type) { return new SQLField(type, sql); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must not be any binding * variables contained in the SQL. *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, 1, 100, 200)";
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @return A field wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Field field(String sql, DataType type) { return field(sql, type, new Object[0]); } /** * Create a "plain SQL" field. *

* A PlainSQLField is a field that can contain user-defined plain SQL, * because sometimes it is easier to express things directly in SQL, for * instance complex proprietary functions. There must be as many binding * variables contained in the SQL, as passed in the bindings parameter *

* Example: *

*

     * String sql = "DECODE(MY_FIELD, ?, ?, ?)";
     * Object[] bindings = new Object[] { 1, 100, 200 };
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param type The field type * @param bindings The bindings for the field * @return A field wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static Field field(String sql, DataType type, Object... bindings) { return field(sql(sql, bindings), type); } /** * Create a "plain SQL" field. *

* This is useful for constructing more complex SQL syntax elements wherever * Field types are expected. An example for this is MySQL's * GROUP_CONCAT aggregate function, which has MySQL-specific * keywords that are hard to reflect in jOOQ's DSL:

     * GROUP_CONCAT([DISTINCT] expr [,expr ...]
     *       [ORDER BY {unsigned_integer | col_name | expr}
     *           [ASC | DESC] [,col_name ...]]
     *       [SEPARATOR str_val])
     *       
*

* The above MySQL function can be expressed as such:

     * field("GROUP_CONCAT(DISTINCT {0} ORDER BY {1} ASC SEPARATOR '-')", expr1, expr2);
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! One way to escape * literals is to use {@link #name(String...)} and similar methods * * @param sql The SQL * @param type The field type * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A field wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static Field field(String sql, DataType type, QueryPart... parts) { return field(sql(sql, parts), type); } /** * A custom SQL clause that can render arbitrary SQL elements. *

* This is useful for constructing more complex SQL syntax elements wherever * Field types are expected. An example for this is MySQL's * GROUP_CONCAT aggregate function, which has MySQL-specific * keywords that are hard to reflect in jOOQ's DSL:

     * GROUP_CONCAT([DISTINCT] expr [,expr ...]
     *       [ORDER BY {unsigned_integer | col_name | expr}
     *           [ASC | DESC] [,col_name ...]]
     *       [SEPARATOR str_val])
     *       
*

* The above MySQL function can be expressed as such:

     * field("GROUP_CONCAT(DISTINCT {0} ORDER BY {1} ASC SEPARATOR '-')", expr1, expr2);
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! One way to escape * literals is to use {@link #name(String...)} and similar methods * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A field wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static Field field(String sql, QueryPart... parts) { return field(sql, (Object[]) parts); } /** * A custom SQL clause that can render arbitrary SQL elements. *

* This is useful for constructing more complex SQL syntax elements wherever * Field types are expected. An example for this is MySQL's * GROUP_CONCAT aggregate function, which has MySQL-specific * keywords that are hard to reflect in jOOQ's DSL:

     * GROUP_CONCAT([DISTINCT] expr [,expr ...]
     *       [ORDER BY {unsigned_integer | col_name | expr}
     *           [ASC | DESC] [,col_name ...]]
     *       [SEPARATOR str_val])
     *       
*

* The above MySQL function can be expressed as such:

     * field("GROUP_CONCAT(DISTINCT {0} ORDER BY {1} ASC SEPARATOR '-')", expr1, expr2);
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! One way to escape * literals is to use {@link #name(String...)} and similar methods * * @param sql The SQL clause, containing {numbered placeholders} where query * parts can be injected * @param type The field type * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A field wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static Field field(String sql, Class type, QueryPart... parts) { return field(sql, getDataType(type), (Object[]) parts); } /** * function() can be used to access native or user-defined * functions that are not yet or insufficiently supported by jOOQ. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param name The function name (without parentheses) * @param type The function return type * @param arguments The function arguments * @see SQL */ @Support @PlainSQL public static Field function(String name, Class type, Field... arguments) { return function(name, getDataType(type), nullSafe(arguments)); } /** * function() can be used to access native or user-defined * functions that are not yet or insufficiently supported by jOOQ. *

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param name The function name (without parentheses) * @param type The function return type * @param arguments The function arguments * @see SQL */ @Support @PlainSQL public static Field function(String name, DataType type, Field... arguments) { return new org.jooq.impl.Function(name, type, nullSafe(arguments)); } /** * function() can be used to access native or user-defined * functions that are not yet or insufficiently supported by jOOQ. * * @param name The function name (possibly qualified) * @param type The function return type * @param arguments The function arguments */ @Support public static Field function(Name name, Class type, Field... arguments) { return function(name, getDataType(type), nullSafe(arguments)); } /** * function() can be used to access native or user-defined * functions that are not yet or insufficiently supported by jOOQ. * * @param name The function name (possibly qualified) * @param type The function return type * @param arguments The function arguments */ @Support public static Field function(Name name, DataType type, Field... arguments) { return new org.jooq.impl.Function(name, type, nullSafe(arguments)); } /** * Create a new condition holding plain SQL. *

* There must not be any binding variables contained in the SQL. *

* Example: *

*

     * String sql = "(X = 1 and Y = 2)";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A condition wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Condition condition(SQL sql) { return new SQLCondition(sql); } /** * Create a new condition holding plain SQL. *

* There must not be any binding variables contained in the SQL. *

* Example: *

*

     * String sql = "(X = 1 and Y = 2)";
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @return A condition wrapping the plain SQL * @see SQL */ @Support @PlainSQL public static Condition condition(String sql) { return condition(sql, new Object[0]); } /** * Create a new condition holding plain SQL. *

* There must be as many binding variables contained in the SQL, as passed * in the bindings parameter *

* Example: *

*

     * String sql = "(X = ? and Y = ?)";
     * Object[] bindings = new Object[] { 1, 2 };
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! * * @param sql The SQL * @param bindings The bindings * @return A condition wrapping the plain SQL * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL public static Condition condition(String sql, Object... bindings) { return condition(sql(sql, bindings)); } /** * A custom SQL clause that can render arbitrary SQL elements. *

* This is useful for constructing more complex SQL syntax elements wherever * Condition types are expected. An example for this are * Postgres's various operators, some of which are missing in the jOOQ API. * For instance, the "overlap" operator for arrays: *

ARRAY[1,4,3] && ARRAY[2,1]
*

* The above Postgres operator can be expressed as such:

     * condition("{0} && {1}", array1, array2);
     * 
*

* NOTE: When inserting plain SQL into jOOQ objects, you must * guarantee syntax integrity. You may also create the possibility of * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! One way to escape * literals is to use {@link #name(String...)} and similar methods * * @param sql The SQL * @param parts The {@link QueryPart} objects that are rendered at the * {numbered placeholder} locations * @return A condition wrapping the plain SQL * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL public static Condition condition(String sql, QueryPart... parts) { return condition(sql, (Object[]) parts); } /** * Create a condition from a boolean field. *

* Databases that support boolean data types can use boolean expressions * as predicates or as columns interchangeably. This extends to any type * of field, including functions. A Postgres example: *

*

     * select 1 where texteq('a', 'a');
     * 
* * @param value The boolean expression. * @return A condition wrapping the boolean expression */ @Support public static Condition condition(Boolean value) { return condition(Tools.field(value, Boolean.class)); } /** * Create a condition from a boolean field. *

* Databases that support boolean data types can use boolean expressions * as predicates or as columns interchangeably. This extends to any type * of field, including functions. A Postgres example: *

*

     * select 1 where texteq('a', 'a');
     * 
* * @param field The boolean expression. * @return A condition wrapping the boolean expression */ @Support public static Condition condition(Field field) { return new FieldCondition(field); } /** * Create a condition from a map. *

* The result is a condition generated from keys and values of the argument map, such that: * *

     * key1 = value1 AND key2 = value2 AND ... AND keyN = valueN
     * 
* * @param map A map containing keys and values to form predicates. * @return A condition comparing keys with values. */ @Support public static Condition condition(Map, ?> map) { return new MapCondition(map); } /** * Create a "Query By Example" (QBE) {@link Condition} from a {@link Record} * . *

* This will take all the non-null values in the argument * record to form a predicate from them. If all values in the * record are null, the predicate will be the * {@link #trueCondition()}. * * @param record The record from which to create a condition. * @return The condition. * @see https://en. * wikipedia.org/wiki/Query_by_Example */ @Support public static Condition condition(Record record) { return new RecordCondition(record); } // ------------------------------------------------------------------------- // XXX Global Condition factory // ------------------------------------------------------------------------- /** * Return a Condition that will always evaluate to true. */ @Support public static Condition trueCondition() { return new TrueCondition(); } /** * Return a Condition that will always evaluate to false. */ @Support public static Condition falseCondition() { return new FalseCondition(); } /** * Return a Condition that connects all argument * conditions with {@link Operator#AND}. */ @Support public static Condition and(Condition... conditions) { return condition(AND, conditions); } /** * Return a Condition that connects all argument * conditions with {@link Operator#AND}. */ @Support public static Condition and(Collection conditions) { return condition(AND, conditions); } /** * Return a Condition that connects all argument * conditions with {@link Operator#OR}. */ @Support public static Condition or(Condition... conditions) { return condition(OR, conditions); } /** * Return a Condition that connects all argument * conditions with {@link Operator#OR}. */ @Support public static Condition or(Collection conditions) { return condition(OR, conditions); } /** * Return a Condition that connects all argument * conditions with Operator. */ @Support public static Condition condition(Operator operator, Condition... conditions) { return condition(operator, asList(conditions)); } /** * Return a Condition that connects all argument * conditions with Operator. */ @Support public static Condition condition(Operator operator, Collection conditions) { return new CombinedCondition(operator, conditions); } /** * Create an exists condition. *

* EXISTS ([query]) */ @Support public static Condition exists(Select query) { return new ExistsCondition(query, true); } /** * Create a not exists condition. *

* NOT EXISTS ([query]) */ @Support public static Condition notExists(Select query) { return new ExistsCondition(query, false); } /** * Invert a condition. *

* This is the same as calling {@link Condition#not()} */ @Support public static Condition not(Condition condition) { return condition.not(); } /** * Invert a boolean value. *

* This is convenience for calling {@link #field(Condition)}, * {@link #not(Condition)}, {@link #condition(Field)}, i.e.

     * field(not(condition(field)));
     * 
* * @deprecated - 3.8.0 - [#4763] - Use {@link #not(Condition)} instead. Due * to ambiguity between calling this method using * {@link Field#equals(Object)} argument, vs. calling the other * method via a {@link Field#equal(Object)} argument, this * method will be removed in the future. */ @Deprecated @Support public static Field not(Boolean value) { return not(Tools.field(value, Boolean.class)); } /** * Invert a boolean value. *

* This is convenience for calling {@link #field(Condition)}, * {@link #not(Condition)}, {@link #condition(Field)}, i.e.

     * field(not(condition(field)));
     * 
*/ @Support public static Field not(Field field) { return new NotField(field); } /** * Transform a condition into a boolean field. */ @Support public static Field field(Condition condition) { return new ConditionAsField(condition); } // ------------------------------------------------------------------------- // XXX Global Field and Function factory // ------------------------------------------------------------------------- /** * Wrap a {@link SelectField} in a general-purpose {@link Field} */ @Support public static Field field(SelectField field) { return field instanceof Field ? (Field) field : field("{0}", field.getDataType(), field); } // [jooq-tools] START [row-field] /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row1)} as a replacement. * * @see #rowField(Row1) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row1 row) { return new RowField, Record1>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row2)} as a replacement. * * @see #rowField(Row2) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row2 row) { return new RowField, Record2>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row3)} as a replacement. * * @see #rowField(Row3) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row3 row) { return new RowField, Record3>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row4)} as a replacement. * * @see #rowField(Row4) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row4 row) { return new RowField, Record4>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row5)} as a replacement. * * @see #rowField(Row5) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row5 row) { return new RowField, Record5>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row6)} as a replacement. * * @see #rowField(Row6) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row6 row) { return new RowField, Record6>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row7)} as a replacement. * * @see #rowField(Row7) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row7 row) { return new RowField, Record7>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row8)} as a replacement. * * @see #rowField(Row8) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row8 row) { return new RowField, Record8>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row9)} as a replacement. * * @see #rowField(Row9) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row9 row) { return new RowField, Record9>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row10)} as a replacement. * * @see #rowField(Row10) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row10 row) { return new RowField, Record10>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row11)} as a replacement. * * @see #rowField(Row11) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row11 row) { return new RowField, Record11>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row12)} as a replacement. * * @see #rowField(Row12) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row12 row) { return new RowField, Record12>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row13)} as a replacement. * * @see #rowField(Row13) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row13 row) { return new RowField, Record13>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row14)} as a replacement. * * @see #rowField(Row14) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row14 row) { return new RowField, Record14>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row15)} as a replacement. * * @see #rowField(Row15) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row15 row) { return new RowField, Record15>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row16)} as a replacement. * * @see #rowField(Row16) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row16 row) { return new RowField, Record16>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row17)} as a replacement. * * @see #rowField(Row17) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row17 row) { return new RowField, Record17>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row18)} as a replacement. * * @see #rowField(Row18) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row18 row) { return new RowField, Record18>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row19)} as a replacement. * * @see #rowField(Row19) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row19 row) { return new RowField, Record19>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row20)} as a replacement. * * @see #rowField(Row20) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row20 row) { return new RowField, Record20>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row21)} as a replacement. * * @see #rowField(Row21) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row21 row) { return new RowField, Record21>(row); } /** * Experimental method removed again. *

* Due to a JDK 8 compiler regression, this overload can cause severe performance issues * with any other single-parameter field() overload. This is why this method has now been * removed again from the public API. *

* For details, see https://github.com/jOOQ/jOOQ/issues/5233. *

* Use {@link #rowField(Row22)} as a replacement. * * @see #rowField(Row22) */ @Generated("This method was generated using jOOQ-tools") @Support private static Field> field(Row22 row) { return new RowField, Record22>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 1 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row1 row) { return new RowField, Record1>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 2 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row2 row) { return new RowField, Record2>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 3 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row3 row) { return new RowField, Record3>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 4 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row4 row) { return new RowField, Record4>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 5 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row5 row) { return new RowField, Record5>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 6 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row6 row) { return new RowField, Record6>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 7 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row7 row) { return new RowField, Record7>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 8 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row8 row) { return new RowField, Record8>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 9 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row9 row) { return new RowField, Record9>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 10 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row10 row) { return new RowField, Record10>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 11 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row11 row) { return new RowField, Record11>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 12 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row12 row) { return new RowField, Record12>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 13 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row13 row) { return new RowField, Record13>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 14 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row14 row) { return new RowField, Record14>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 15 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row15 row) { return new RowField, Record15>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 16 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row16 row) { return new RowField, Record16>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 17 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row17 row) { return new RowField, Record17>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 18 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row18 row) { return new RowField, Record18>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 19 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row19 row) { return new RowField, Record19>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 20 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row20 row) { return new RowField, Record20>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 21 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row21 row) { return new RowField, Record21>(row); } /** * EXPERIMENTAL: Turn a row value expression of degree 22 into a {@code Field}. *

* Note: Not all databases support row value expressions, but many row value * expression operations can be emulated on all databases. See relevant row * value expression method Javadocs for details. */ @Generated("This method was generated using jOOQ-tools") @Support public static Field> rowField(Row22 row) { return new RowField, Record22>(row); } // [jooq-tools] END [row-field] /** * Transform a subquery into a correlated subquery. */ @Support public static Field field(Select> select) { if (select == null) return (Field) NULL(); else return select.asField(); } /** * Initialise a {@link Case} statement. *

* Choose is used as a method name to avoid name clashes with Java's * reserved literal "case" * * @see Case */ @Support public static Case choose() { return decode(); } /** * Initialise a {@link Case} statement. *

* This API can be used to create expressions of the type

     * CASE value WHEN 1 THEN 'one'
     *            WHEN 2 THEN 'two'
     *            ELSE        'three'
     * END
     * 
*

* Choose is used as a method name to avoid name clashes with Java's * reserved literal "case". * * @see Case */ @Support public static CaseValueStep choose(V value) { return decode().value(value); } /** * Initialise a {@link Case} statement. *

* This API can be used to create expressions of the type

     * CASE value WHEN 1 THEN 'one'
     *            WHEN 2 THEN 'two'
     *            ELSE        'three'
     * END
     * 
*

* Choose is used as a method name to avoid name clashes with Java's * reserved literal "case". * * @see Case */ @Support public static CaseValueStep choose(Field value) { return decode().value(value); } /** * Initialise a {@link Case} statement. *

* This API can be used to create expressions of the type

     * CASE WHEN x < 1  THEN 'one'
     *      WHEN x >= 2 THEN 'two'
     *      ELSE            'three'
     * END
     * 
*

* Choose is used as a method name to avoid name clashes with Java's * reserved literal "case". */ @Support public static CaseConditionStep when(Condition condition, T result) { return decode().when(condition, result); } /** * Initialise a {@link Case} statement. *

* This API can be used to create expressions of the type

     * CASE WHEN x < 1  THEN 'one'
     *      WHEN x >= 2 THEN 'two'
     *      ELSE            'three'
     * END
     * 
*

* Choose is used as a method name to avoid name clashes with Java's * reserved literal "case". */ @Support public static CaseConditionStep when(Condition condition, Field result) { return decode().when(condition, result); } /** * Initialise a {@link Case} statement. *

* This API can be used to create expressions of the type

     * CASE WHEN x < 1  THEN 'one'
     *      WHEN x >= 2 THEN 'two'
     *      ELSE            'three'
     * END
     * 
*

* Choose is used as a method name to avoid name clashes with Java's * reserved literal "case". */ @Support public static CaseConditionStep when(Condition condition, Select> result) { return decode().when(condition, result); } /** * Initialise a {@link Case} statement. *

* Decode is used as a method name to avoid name clashes with Java's * reserved literal "case" * * @see Case */ @Support public static Case decode() { return new CaseImpl(); } /** * Gets the Oracle-style * DECODE(expression, search, result[, search , result]... [, default]) * function. * * @see #decode(Field, Field, Field, Field[]) */ @Support public static Field decode(T value, T search, Z result) { return decode(value, search, result, new Object[0]); } /** * Gets the Oracle-style * DECODE(expression, search, result[, search , result]... [, default]) * function. * * @see #decode(Field, Field, Field, Field[]) */ @Support public static Field decode(T value, T search, Z result, Object... more) { return decode(Tools.field(value), Tools.field(search), Tools.field(result), Tools.fields(more).toArray(EMPTY_FIELD)); } /** * Gets the Oracle-style * DECODE(expression, search, result[, search , result]... [, default]) * function. * * @see #decode(Field, Field, Field, Field[]) */ @Support public static Field decode(Field value, Field search, Field result) { return decode(nullSafe(value), nullSafe(search), nullSafe(result), EMPTY_FIELD); } /** * Gets the Oracle-style * DECODE(expression, search, result[, search , result]... [, default]) * function. *

* Returns the dialect's equivalent to DECODE: *

*

* Other dialects:

     * CASE WHEN [this IS NOT DISTINCT FROM search] THEN [result],
     *     [WHEN more...                            THEN more...]
     *     [ELSE more...]
     * END
     * 
*

* Note the use of the DISTINCT predicate to produce the same, * conveniently NULL-agnostic behaviour as Oracle. * * @param value The value to decode * @param search the mandatory first search parameter * @param result the mandatory first result candidate parameter * @param more the optional parameters. If more.length is even, * then it is assumed that it contains more search/result pairs. * If more.length is odd, then it is assumed that it * contains more search/result pairs plus a default at the end. */ @Support public static Field decode(Field value, Field search, Field result, Field... more) { return new Decode(nullSafe(value), nullSafe(search), nullSafe(result), nullSafe(more)); } /** * Coerce this field to the type of another field. * * @see #coerce(Field, Field) */ @Support public static Field coerce(Object value, Field as) { return Tools.field(value).coerce(as); } /** * Coerce this field to another type. * * @see #coerce(Field, Class) */ @Support public static Field coerce(Object value, Class as) { return Tools.field(value).coerce(as); } /** * Coerce a field to another type. * * @see #coerce(Field, DataType) */ @Support public static Field coerce(Object value, DataType as) { return Tools.field(value).coerce(as); } /** * 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 to be coerced * @param as The field whose type is used for the coercion * @return The coerced field * @see Field#coerce(DataType) * @see Field#cast(Field) */ @Support public static Field coerce(Field field, Field as) { return nullSafe(field).coerce(as); } /** * 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 field The field to be coerced * @param as The type that is used for the coercion * @return The coerced field * @see Field#coerce(DataType) * @see Field#cast(Class) */ @Support public static Field coerce(Field field, Class as) { return nullSafe(field).coerce(as); } /** * Coerce a 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 field The field to be coerced * @param as The type that is used for the coercion * @return The coerced field * @see Field#coerce(DataType) * @see Field#cast(DataType) */ @Support public static Field coerce(Field field, DataType as) { return nullSafe(field).coerce(as); } /** * Cast a value to the type of another field. * * @param The generic type of the cast field * @param value The value to cast * @param as The field whose type is used for the cast * @return The cast field */ @Support public static Field cast(Object value, Field as) { return Tools.field(value, as).cast(as); } /** * Cast a field to the type of another field. * * @param The generic type of the cast field * @param field The field to cast * @param as The field whose type is used for the cast * @return The cast field */ @Support public static Field cast(Field field, Field as) { return nullSafe(field).cast(as); } /** * Cast null to the type of another field. * * @param The generic type of the cast field * @param as The field whose type is used for the cast * @return The cast field */ @Support public static Field castNull(Field as) { return NULL().cast(as); } /** * Cast a value to another type. * * @param The generic type of the cast field * @param value The value to cast * @param type The type that is used for the cast * @return The cast field */ @Support public static Field cast(Object value, Class type) { return Tools.field(value, type).cast(type); } /** * Cast a field to another type. * * @param The generic type of the cast field * @param field The field to cast * @param type The type that is used for the cast * @return The cast field */ @Support public static Field cast(Field field, Class type) { return nullSafe(field).cast(type); } /** * Cast null to a type. * * @param The generic type of the cast field * @param type The type that is used for the cast * @return The cast field */ @Support public static Field castNull(DataType type) { return NULL().cast(type); } /** * Cast a value to another type. * * @param The generic type of the cast field * @param value The value to cast * @param type The type that is used for the cast * @return The cast field */ @Support public static Field cast(Object value, DataType type) { return Tools.field(value).cast(type); } /** * Cast a field to another type. * * @param The generic type of the cast field * @param field The value to cast * @param type The type that is used for the cast * @return The cast field */ @Support public static Field cast(Field field, DataType type) { return nullSafe(field).cast(type); } /** * Cast null to a type. * * @param The generic type of the cast field * @param type The type that is used for the cast * @return The cast field */ @Support public static Field castNull(Class type) { return NULL().cast(type); } /** * Cast all fields that need casting. * * @param The generic field type * @param type The type to cast to * @param fields The fields to be cast to a uniform type * @return The cast fields */ static Field[] castAll(Class type, Field... fields) { Field[] castFields = new Field[fields.length]; for (int i = 0; i < fields.length; i++) { castFields[i] = fields[i].cast(type); } return (Field[]) castFields; } /** * The COALESCE(value1, value2, ... , value n) function. * * @see #coalesce(Field, Field...) */ @Support public static Field coalesce(T value, T... values) { return coalesce0(Tools.field(value), Tools.fields(values).toArray(EMPTY_FIELD)); } /** * The COALESCE(field, value) function. * * @see #coalesce(Field, Field...) */ @Support public static Field coalesce(Field field, T value) { return coalesce0(field, Tools.field(value, field)); } /** * The COALESCE(field1, field2, ... , field n) function. */ @Support public static Field coalesce(Field field, Field... fields) { return coalesce0(field, fields); } // Java 8 is stricter than Java 7 with respect to generics and overload // resolution (http://stackoverflow.com/q/5361513/521799) static Field coalesce0(Field field, Field... fields) { return new Coalesce(nullSafeDataType(field), nullSafe(combine(field, fields))); } /** * Gets the SQL Server-style ISNULL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field isnull(T value, T defaultValue) { return nvl(value, defaultValue); } /** * Gets the SQL Server-style ISNULL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field isnull(T value, Field defaultValue) { return nvl(value, defaultValue); } /** * Gets the SQL Server-style ISNULL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field isnull(Field value, T defaultValue) { return nvl(value, defaultValue); } /** * Gets the SQL Server-style ISNULL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field isnull(Field value, Field defaultValue) { return nvl(value, defaultValue); } /** * Gets the Oracle-style NVL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field nvl(T value, T defaultValue) { return nvl0(Tools.field(value), Tools.field(defaultValue)); } /** * Gets the Oracle-style NVL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field nvl(T value, Field defaultValue) { return nvl0(Tools.field(value), nullSafe(defaultValue)); } /** * Gets the Oracle-style NVL(value, defaultValue) function. * * @see #nvl(Field, Field) */ @Support public static Field nvl(Field value, T defaultValue) { return nvl0(nullSafe(value), Tools.field(defaultValue)); } /** * Gets the Oracle-style NVL(value, defaultValue) function. *

* Returns the dialect's equivalent to NVL: *

*/ @Support public static Field nvl(Field value, Field defaultValue) { return nvl0(value, defaultValue); } /** * The IFNULL() function, a synonym of NVL(). * * @see #nvl(Field, Field) */ @Support public static Field ifnull(T value, T defaultValue) { return nvl(value, defaultValue); } /** * The IFNULL() function, a synonym of NVL(). * * @see #nvl(Field, Field) */ @Support public static Field ifnull(T value, Field defaultValue) { return nvl(value, defaultValue); } /** * The IFNULL() function, a synonym of NVL(). * * @see #nvl(Field, Object) */ @Support public static Field ifnull(Field value, T defaultValue) { return nvl(value, defaultValue); } /** * The IFNULL() function, a synonym of NVL(). * * @see #nvl(Field, Field) */ @Support public static Field ifnull(Field value, Field defaultValue) { return nvl(value, defaultValue); } // Java 8 is stricter than Java 7 with respect to generics and overload // resolution (http://stackoverflow.com/q/5361513/521799) static Field nvl0(Field value, Field defaultValue) { return new Nvl(nullSafe(value), nullSafe(defaultValue)); } /** * Gets the Oracle-style NVL2(value, valueIfNotNull, valueIfNull) function. * * @see #nvl2(Field, Field, Field) */ @Support public static Field nvl2(Field value, Z valueIfNotNull, Z valueIfNull) { return nvl20(nullSafe(value), Tools.field(valueIfNotNull), Tools.field(valueIfNull)); } /** * Gets the Oracle-style NVL2(value, valueIfNotNull, valueIfNull) function. * * @see #nvl2(Field, Field, Field) */ @Support public static Field nvl2(Field value, Z valueIfNotNull, Field valueIfNull) { return nvl20(nullSafe(value), Tools.field(valueIfNotNull), nullSafe(valueIfNull)); } /** * Gets the Oracle-style NVL2(value, valueIfNotNull, valueIfNull) function. * * @see #nvl2(Field, Field, Field) */ @Support public static Field nvl2(Field value, Field valueIfNotNull, Z valueIfNull) { return nvl20(nullSafe(value), nullSafe(valueIfNotNull), Tools.field(valueIfNull)); } /** * Gets the Oracle-style NVL2(value, valueIfNotNull, valueIfNull) function. *

* Returns the dialect's equivalent to NVL2: *

*

* Other dialects: * CASE WHEN [value] IS NULL THEN [valueIfNull] ELSE [valueIfNotNull] END */ @Support public static Field nvl2(Field value, Field valueIfNotNull, Field valueIfNull) { return nvl20(value, valueIfNotNull, valueIfNull); } // Java 8 is stricter than Java 7 with respect to generics and overload // resolution (http://stackoverflow.com/q/5361513/521799) static Field nvl20(Field value, Field valueIfNotNull, Field valueIfNull) { return new Nvl2(nullSafe(value), nullSafe(valueIfNotNull), nullSafe(valueIfNull)); } /** * Gets the Oracle-style NULLIF(value, other) function. * * @see #nullif(Field, Field) */ @Support public static Field nullif(T value, T other) { return nullif0(Tools.field(value), Tools.field(other)); } /** * Gets the Oracle-style NULLIF(value, other) function. * * @see #nullif(Field, Field) */ @Support public static Field nullif(T value, Field other) { return nullif0(Tools.field(value), nullSafe(other)); } /** * Gets the Oracle-style NULLIF(value, other) function. * * @see #nullif(Field, Field) */ @Support public static Field nullif(Field value, T other) { return nullif0(nullSafe(value), Tools.field(other)); } /** * Gets the Oracle-style NULLIF(value, other) function. *

* Returns the dialect's equivalent to NULLIF: *

*

*/ @Support public static Field nullif(Field value, Field other) { return nullif0(value, other); } // Java 8 is stricter than Java 7 with respect to generics and overload // resolution (http://stackoverflow.com/q/5361513/521799) static Field nullif0(Field value, Field other) { return new NullIf(nullSafe(value), nullSafe(other)); } // ------------------------------------------------------------------------- // XXX String function factory // ------------------------------------------------------------------------- /** * Get the upper(field) function. * * @see #upper(Field) */ @Support public static Field upper(String value) { return upper(Tools.field(value)); } /** * Get the upper(field) function. *

* This renders the upper function in all dialects: *

upper([field])
*/ @Support public static Field upper(Field field) { return new Upper(nullSafe(field)); } /** * Get the lower(field) function. * * @see #lower(Field) */ @Support public static Field lower(String value) { return lower(Tools.field(value, String.class)); } /** * Get the lower(field) function. *

* This renders the lower function in all dialects: *

lower([field])
*/ @Support public static Field lower(Field field) { return new Lower(nullSafe(field)); } /** * Get the trim(field) function. * * @see #trim(Field) */ @Support public static Field trim(String value) { return trim(Tools.field(value, String.class)); } /** * Get the trim(field) function. *

* This renders the trim function where available: *

trim([field])
... or emulates it elsewhere using * rtrim and ltrim:
ltrim(rtrim([field]))
*/ @Support public static Field trim(Field field) { return new Trim(nullSafe(field)); } /** * Get the rtrim(field) function. * * @see #rtrim(Field) */ @Support public static Field rtrim(String value) { return rtrim(Tools.field(value)); } /** * Get the rtrim(field) function. *

* This renders the rtrim function in all dialects: *

rtrim([field])
*/ @Support public static Field rtrim(Field field) { return new RTrim(nullSafe(field)); } /** * Get the ltrim(field) function. * * @see #ltrim(Field) */ @Support public static Field ltrim(String value) { return ltrim(Tools.field(value, String.class)); } /** * Get the ltrim(field) function. *

* This renders the ltrim function in all dialects: *

ltrim([field])
*/ @Support public static Field ltrim(Field field) { return new LTrim(nullSafe(field)); } /** * Get the rpad(field, length) function. * * @see #rpad(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field rpad(Field field, int length) { return rpad(nullSafe(field), Tools.field(length)); } /** * Get the rpad(field, length) function. *

* This renders the rpad function where available: *

rpad([field], [length])
... or emulates it * elsewhere using concat, repeat, and length, which may be emulated as * well, depending on the RDBMS: *
concat([field], repeat(' ', [length] - length([field])))
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field rpad(Field field, Field length) { return new Rpad(nullSafe(field), nullSafe(length)); } /** * Get the rpad(field, length, character) function. * * @see #rpad(Field, Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field rpad(Field field, int length, char character) { return rpad(field, length, Character.toString(character)); } /** * Get the rpad(field, length, character) function. * * @see #rpad(Field, Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field rpad(Field field, int length, String character) { return rpad(nullSafe(field), Tools.field(length), Tools.field(character, String.class)); } /** * Get the rpad(field, length, character) function. *

* This renders the rpad function where available: *

rpad([field], [length])
... or emulates it * elsewhere using concat, repeat, and length, which may be emulated as * well, depending on the RDBMS: *
concat([field], repeat([character], [length] - length([field])))
*

* In {@link SQLDialect#SQLITE}, this is emulated as such: *

[field] || replace(replace(substr(quote(zeroblob(([length] + 1) / 2)), 3, ([length] - length([field]))), '\''', ''), '0', [character])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field rpad(Field field, Field length, Field character) { return new Rpad(nullSafe(field), nullSafe(length), nullSafe(character)); } /** * Get the lpad(field, length) function. * * @see #lpad(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field lpad(Field field, int length) { return lpad(nullSafe(field), Tools.field(length)); } /** * Get the lpad(field, length) function. *

* This renders the lpad function where available: *

lpad([field], [length])
... or emulates it * elsewhere using concat, repeat, and length, which may be emulated as * well, depending on the RDBMS: *
concat(repeat(' ', [length] - length([field])), [field])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field lpad(Field field, Field length) { return new Lpad(nullSafe(field), nullSafe(length)); } /** * Get the lpad(field, length, character) function. * * @see #lpad(Field, Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field lpad(Field field, int length, char character) { return lpad(field, length, Character.toString(character)); } /** * Get the lpad(field, length, character) function. * * @see #lpad(Field, Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field lpad(Field field, int length, String character) { return lpad(nullSafe(field), Tools.field(length), Tools.field(character, String.class)); } /** * Get the lpad(field, length, character) function. *

* This renders the lpad function where available: *

lpad([field], [length])
... or emulates it * elsewhere using concat, repeat, and length, which may be emulated as * well, depending on the RDBMS: *
concat(repeat([character], [length] - length([field])), [field])
*

* In {@link SQLDialect#SQLITE}, this is emulated as such: *

replace(replace(substr(quote(zeroblob(([length] + 1) / 2)), 3, ([length] - length([field]))), '\''', ''), '0', [character]) || [field]
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field lpad(Field field, Field length, Field character) { return new Lpad(nullSafe(field), nullSafe(length), nullSafe(character)); } /** * Get the repeat(field, count) function. * * @see #repeat(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field repeat(String field, int count) { return repeat(Tools.field(field, String.class), Tools.field(count)); } /** * Get the repeat(field, count) function. * * @see #repeat(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field repeat(String field, Field count) { return repeat(Tools.field(field, String.class), nullSafe(count)); } /** * Get the repeat(count) function. * * @see #repeat(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field repeat(Field field, int count) { return repeat(nullSafe(field), Tools.field(count)); } /** * Get the repeat(field, count) function. *

* This renders the repeat or replicate function where available: *

repeat([field], [count]) or
     * replicate([field], [count])
... or emulates it elsewhere * using rpad and length, which may be emulated as well, depending on the * RDBMS: *
rpad([field], length([field]) * [count], [field])
*

* In {@link SQLDialect#SQLITE}, this is emulated as such: *

replace(substr(quote(zeroblob(([count] + 1) / 2)), 3, [count]), '0', [field])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field repeat(Field field, Field count) { return new Repeat(nullSafe(field), nullSafe(count)); } /** * Get the SQL Server specific SPACE() function. *

* This function can be emulated using {@link #repeat(String, int)} in * dialects that do not ship with a native SPACE() function. * * @see http://technet.microsoft.com/en-us/library/ms187950.aspx */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field space(int value) { return space(val(value)); } /** * Get the SQL Server specific SPACE() function. *

* This function can be emulated using {@link #repeat(String, int)} in * dialects that do not ship with a native SPACE() function. * * @see http://technet.microsoft.com/en-us/library/ms187950.aspx */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field space(Field value) { return new Space(nullSafe(value)); } /** * Get the reverse(field) function. */ @Support({ CUBRID, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field reverse(String value) { return reverse(val(value)); } /** * Get the reverse(field) function. */ @Support({ CUBRID, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field reverse(Field field) { return new Reverse(nullSafe(field)); } /** * Convenience method for {@link #replace(Field, String, String)} to escape * data for use with {@link Field#like(Field, char)}. *

* Essentially, this escapes % and _ characters * * @see #replace(Field, String, String) * @see Field#like(Field, char) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static String escape(String value, char escape) { String esc = "" + escape; return value.replace(esc, esc + esc).replace("%", esc + "%").replace("_", esc + "_"); } /** * Convenience method for {@link #replace(Field, String, String)} to escape * data for use with {@link Field#like(Field, char)}. *

* Essentially, this escapes % and _ characters * * @see #replace(Field, String, String) * @see Field#like(Field, char) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field escape(Field field, char escape) { Field replace = field; String esc = "" + escape; replace = replace(replace, inline(esc), inline(esc + esc)); replace = replace(replace, inline("%"), inline(esc + "%")); replace = replace(replace, inline("_"), inline(esc + "_")); return replace; } /** * Get the replace(field, search) function. * * @see #replace(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field replace(Field field, String search) { return replace(nullSafe(field), Tools.field(search, String.class)); } /** * Get the replace(field, search) function. *

* This renders the replace or str_replace function where available: *

replace([field], [search]) or
     * str_replace([field], [search])
... or emulates it elsewhere * using the three-argument replace function: *
replace([field], [search], '')
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field replace(Field field, Field search) { return new Replace(nullSafe(field), nullSafe(search)); } /** * Get the replace(field, search, replace) function. * * @see #replace(Field, Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field replace(Field field, String search, String replace) { return replace(nullSafe(field), Tools.field(search, String.class), Tools.field(replace, String.class)); } /** * Get the replace(field, search, replace) function. *

* This renders the replace or str_replace function: *

replace([field], [search]) or
     * str_replace([field], [search])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field replace(Field field, Field search, Field replace) { return new Replace(nullSafe(field), nullSafe(search), nullSafe(replace)); } /** * Get the position(in, search) function. * * @see #position(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(String in, String search) { return position(Tools.field(in, String.class), Tools.field(search, String.class)); } /** * Get the position(in, search) function. * * @see #position(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(String in, Field search) { return position(Tools.field(in, String.class), nullSafe(search)); } /** * Get the position(in, search) function. * * @see #position(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(Field in, String search) { return position(nullSafe(in), Tools.field(search, String.class)); } /** * Get the position(in, search) function. *

* This renders the position or any equivalent function: *

position([search] in [in]) or
     * locate([in], [search]) or
     * locate([search], [in]) or
     * instr([in], [search]) or
     * charindex([search], [in])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(Field in, Field search) { return new Position(nullSafe(search), nullSafe(in)); } /** * Get the position(in, search, startindex) function. * * @see #position(Field, Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(String in, String search, int startIndex) { return position(Tools.field(in, String.class), Tools.field(search, String.class), Tools.field(startIndex)); } /** * Get the position(in, search, startindex) function. * * @see #position(Field, Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(String in, Field search, int startIndex) { return position(Tools.field(in, String.class), nullSafe(search), Tools.field(startIndex)); } /** * Get the position(in, search, startindex) function. * * @see #position(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(Field in, String search, int startIndex) { return position(nullSafe(in), Tools.field(search, String.class), Tools.field(startIndex)); } /** * Get the position(in, search, startindex) function. *

* This renders the position or any equivalent function: *

position([search] in [in]) or
     * locate([in], [search]) or
     * locate([search], [in]) or
     * instr([in], [search]) or
     * charindex([search], [in])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(Field in, Field search, int startIndex) { return position(nullSafe(search), nullSafe(in), Tools.field(startIndex)); } /** * Get the position(in, search, startindex) function. * * @see #position(Field, Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(String in, String search, Field startIndex) { return position(Tools.field(in, String.class), Tools.field(search, String.class), nullSafe(startIndex)); } /** * Get the position(in, search, startindex) function. * * @see #position(Field, Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(String in, Field search, Field startIndex) { return position(Tools.field(in, String.class), nullSafe(search), nullSafe(startIndex)); } /** * Get the position(in, search, startindex) function. * * @see #position(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(Field in, String search, Field startIndex) { return position(nullSafe(in), Tools.field(search, String.class), nullSafe(startIndex)); } /** * Get the position(in, search, startindex) function. *

* This renders the position or any equivalent function: *

position([search] in [in]) or
     * locate([in], [search]) or
     * locate([search], [in]) or
     * instr([in], [search]) or
     * charindex([search], [in])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field position(Field in, Field search, Field startIndex) { return new Position(nullSafe(search), nullSafe(in), nullSafe(startIndex)); } /** * Get the ascii(field) function. * * @see #ascii(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field ascii(String field) { return ascii(Tools.field(field, String.class)); } /** * Get the ascii(field) function. *

* This renders the ascii function: *

ascii([field])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field ascii(Field field) { return new Ascii(nullSafe(field)); } /** * Get the concat(field, value) function. * * @see #concat(Field...) */ @Support public static Field concat(Field field, String value) { return concat(nullSafe(field), Tools.field(value, String.class)); } /** * Get the concat(value, field) function. * * @see #concat(Field...) */ @Support public static Field concat(String value, Field field) { return concat(Tools.field(value, String.class), nullSafe(field)); } /** * Get the concat(value[, value, ...]) function. * * @see #concat(Field...) */ @Support public static Field concat(String... values) { return concat(Tools.fields(values).toArray(EMPTY_FIELD)); } /** * Get the concat(field[, field, ...]) function. *

* This creates fields[0] || fields[1] || ... as an * expression, or concat(fields[0], fields[1], ...), * depending on the dialect. *

* If any of the given fields is not a {@link String} field, they are cast * to Field<String> first using {@link #cast(Object, Class)} */ @Support public static Field concat(Field... fields) { return new Concat(nullSafe(fields)); } /** * Get the substring(field, startingPosition) function. * * @see #substring(Field, Field) */ @Support public static Field substring(Field field, int startingPosition) { return substring(nullSafe(field), Tools.field(startingPosition)); } /** * Get the substring(field, startingPosition) function. *

* This renders the substr or substring function: *

substr([field], [startingPosition]) or
     * substring([field], [startingPosition])
*/ @Support public static Field substring(Field field, Field startingPosition) { return new Substring(nullSafe(field), nullSafe(startingPosition)); } /** * Get the substring(field, startingPosition, length) function. * * @see #substring(Field, Field, Field) */ @Support public static Field substring(Field field, int startingPosition, int length) { return substring(nullSafe(field), Tools.field(startingPosition), Tools.field(length)); } /** * Get the substring(field, startingPosition, length) function. *

* This renders the substr or substring function: *

substr([field], [startingPosition], [length]) or
     * substring([field], [startingPosition], [length])
*/ @Support public static Field substring(Field field, Field startingPosition, Field length) { return new Substring(nullSafe(field), nullSafe(startingPosition), nullSafe(length)); } /** * Get the mid(field, startingPosition, length) function. * * @see #substring(Field, Field, Field) */ @Support public static Field mid(Field field, int startingPosition, int length) { return substring(nullSafe(field), Tools.field(startingPosition), Tools.field(length)); } /** * Get the mid(field, startingPosition, length) function. *

* This renders the substr or substring function: *

substr([field], [startingPosition], [length]) or
     * substring([field], [startingPosition], [length])
*/ @Support public static Field mid(Field field, Field startingPosition, Field length) { return substring(nullSafe(field), nullSafe(startingPosition), nullSafe(length)); } /** * Get the left outermost characters from a string. *

* Example: *

     * 'abc' = LEFT('abcde', 3)
     * 
*/ @Support public static Field left(String field, int length) { return left(Tools.field(field), Tools.field(length)); } /** * Get the left outermost characters from a string. *

* Example: *

     * 'abc' = LEFT('abcde', 3)
     * 
*/ @Support public static Field left(String field, Field length) { return left(Tools.field(field), nullSafe(length)); } /** * Get the left outermost characters from a string. *

* Example: *

     * 'abc' = LEFT('abcde', 3)
     * 
*/ @Support public static Field left(Field field, int length) { return left(nullSafe(field), Tools.field(length)); } /** * Get the left outermost characters from a string. *

* Example: *

     * 'abc' = LEFT('abcde', 3)
     * 
*/ @Support public static Field left(Field field, Field length) { return new Left(field, length); } /** * Get the right outermost characters from a string. *

* Example: *

     * 'cde' = RIGHT('abcde', 3)
     * 
*/ @Support public static Field right(String field, int length) { return right(Tools.field(field), Tools.field(length)); } /** * Get the right outermost characters from a string. *

* Example: *

     * 'cde' = RIGHT('abcde', 3)
     * 
*/ @Support public static Field right(String field, Field length) { return right(Tools.field(field), nullSafe(length)); } /** * Get the right outermost characters from a string. *

* Example: *

     * 'cde' = RIGHT('abcde', 3)
     * 
*/ @Support public static Field right(Field field, int length) { return right(nullSafe(field), Tools.field(length)); } /** * Get the right outermost characters from a string. *

* Example: *

     * 'cde' = RIGHT('abcde', 3)
     * 
*/ @Support public static Field right(Field field, Field length) { return new Right(field, length); } /** * Get the length of a VARCHAR type. This is a synonym for * {@link #charLength(String)}. * * @see #charLength(String) */ @Support public static Field length(String value) { return length(Tools.field(value, String.class)); } /** * Get the length of a VARCHAR type. This is a synonym for * {@link #charLength(Field)}. * * @see #charLength(Field) */ @Support public static Field length(Field field) { return charLength(field); } /** * Get the char_length(field) function. *

* This translates into any dialect */ @Support public static Field charLength(String value) { return charLength(Tools.field(value)); } /** * Get the char_length(field) function. *

* This translates into any dialect */ @Support public static Field charLength(Field field) { return new org.jooq.impl.Function(Term.CHAR_LENGTH, SQLDataType.INTEGER, nullSafe(field)); } /** * Get the bit_length(field) function. *

* This translates into any dialect */ @Support public static Field bitLength(String value) { return bitLength(Tools.field(value)); } /** * Get the bit_length(field) function. *

* This translates into any dialect */ @Support public static Field bitLength(Field field) { return new org.jooq.impl.Function(Term.BIT_LENGTH, SQLDataType.INTEGER, nullSafe(field)); } /** * Get the octet_length(field) function. *

* This translates into any dialect */ @Support public static Field octetLength(String value) { return octetLength(Tools.field(value, String.class)); } /** * Get the octet_length(field) function. *

* This translates into any dialect */ @Support public static Field octetLength(Field field) { return new org.jooq.impl.Function(Term.OCTET_LENGTH, SQLDataType.INTEGER, nullSafe(field)); } // ------------------------------------------------------------------------ // XXX Hash function factory // ------------------------------------------------------------------------ /** * Get the MySQL-specific MD5() function. *

* These are the implementations for various databases: *

*

* * * * * * * * * * * * *
DatabaseImplementation
MySQLMD5( ... )
Oracle * LOWER(RAWTOHEX(SYS.DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW( ... ), SYS.DBMS_CRYPTO.HASH_MD5))) *
*/ @Support({ MARIADB, MYSQL }) public static Field md5(String string) { return md5(Tools.field(string)); } /** * Get the MySQL-specific MD5() function. *

* These are the implementations for various databases: *

*

* * * * * * * * * * * * *
DatabaseImplementation
MySQLMD5( ... )
Oracle * LOWER(RAWTOHEX(SYS.DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW( ... ), SYS.DBMS_CRYPTO.HASH_MD5))) *
*/ @Support({ MARIADB, MYSQL }) public static Field md5(Field string) { return new MD5(nullSafe(string)); } // ------------------------------------------------------------------------ // XXX Date and time functions // ------------------------------------------------------------------------ /** * Get the current_date() function. *

* This translates into any dialect */ @Support public static Field currentDate() { return new CurrentDate(SQLDataType.DATE); } /** * Get the current_time() function. *

* This translates into any dialect */ @Support public static Field

* This translates into any dialect */ @Support public static Field currentTimestamp() { return new CurrentTimestamp(SQLDataType.TIMESTAMP); } /** * Get the current_date() function. *

* This translates into any dialect */ @Support public static Field currentLocalDate() { return new CurrentDate<>(SQLDataType.LOCALDATE); } /** * Get the current_time() function. *

* This translates into any dialect */ @Support public static Field currentLocalTime() { return new CurrentTime<>(SQLDataType.LOCALTIME); } /** * Get the current_timestamp() function. *

* This translates into any dialect */ @Support public static Field currentLocalDateTime() { return new CurrentTimestamp<>(SQLDataType.LOCALDATETIME); } /** * Get the current_time() function. *

* This translates into any dialect */ @Support public static Field currentOffsetTime() { return currentTime().cast(SQLDataType.OFFSETTIME); } /** * Get the current_timestamp() function. *

* This translates into any dialect */ @Support public static Field currentOffsetDateTime() { return currentTimestamp().cast(SQLDataType.OFFSETDATETIME); } /** * Get the date difference in number of days. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field dateDiff(Date date1, Date date2) { return dateDiff(Tools.field(date1), Tools.field(date2)); } /** * Get the date difference in number of days. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field dateDiff(Field date1, Date date2) { return dateDiff(nullSafe(date1), Tools.field(date2)); } /** * Add an interval to a date. *

* This translates into any dialect * * @see Field#add(Number) */ @Support public static Field dateAdd(Date date, Number interval) { return dateAdd(Tools.field(date), Tools.field(interval)); } /** * Add an interval to a date. *

* This translates into any dialect * * @see Field#add(Field) */ @Support public static Field dateAdd(Field date, Field interval) { return nullSafe(date).add(interval); } /** * Add an interval to a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateAdd(Date date, Number interval, DatePart datePart) { return dateAdd(Tools.field(date), Tools.field(interval), datePart); } /** * Add an interval to a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateAdd(Date date, Field interval, DatePart datePart) { return dateAdd(Tools.field(date), nullSafe(interval), datePart); } /** * Add an interval to a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateAdd(Field date, Number interval, DatePart datePart) { return dateAdd(nullSafe(date), Tools.field(interval), datePart); } /** * Add an interval to a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateAdd(Field date, Field interval, DatePart datePart) { return new DateAdd(nullSafe(date), nullSafe(interval), datePart); } /** * Subtract an interval from a date. *

* This translates into any dialect * * @see Field#add(Number) */ @Support public static Field dateSub(Date date, Number interval) { return dateSub(Tools.field(date), Tools.field(interval)); } /** * Subtract an interval from a date. *

* This translates into any dialect * * @see Field#add(Field) */ @Support public static Field dateSub(Field date, Field interval) { return nullSafe(date).sub(interval); } /** * Subtract an interval from a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateSub(Date date, Number interval, DatePart datePart) { return dateSub(Tools.field(date), Tools.field(interval), datePart); } /** * Subtract an interval from a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateSub(Date date, Field interval, DatePart datePart) { return dateSub(Tools.field(date), nullSafe(interval), datePart); } /** * Subtract an interval from a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateSub(Field date, Number interval, DatePart datePart) { return dateSub(nullSafe(date), Tools.field(interval), datePart); } /** * Subtract an interval from a date, given a date part. *

* This translates into any dialect */ @Support public static Field dateSub(Field date, Field interval, DatePart datePart) { return new DateAdd(nullSafe(date), nullSafe(interval).neg(), datePart); } /** * Get the date difference in number of days. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field dateDiff(Date date1, Field date2) { return dateDiff(Tools.field(date1), nullSafe(date2)); } /** * Get the date difference in number of days. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field dateDiff(Field date1, Field date2) { return new DateDiff(nullSafe(date1), nullSafe(date2)); } /** * Add an interval to a timestamp. *

* This translates into any dialect * * @see Field#add(Number) */ @Support public static Field timestampAdd(Timestamp timestamp, Number interval) { return timestampAdd(Tools.field(timestamp), Tools.field(interval)); } /** * Add an interval to a timestamp. *

* This translates into any dialect * * @see Field#add(Field) */ @Support public static Field timestampAdd(Field timestamp, Field interval) { return nullSafe(timestamp).add(interval); } /** * Add an interval to a timestamp, given a date part. *

* This translates into any dialect */ @Support public static Field timestampAdd(Timestamp date, Number interval, DatePart datePart) { return new DateAdd(Tools.field(date), Tools.field(interval), datePart); } /** * Add an interval to a timestamp, given a date part. *

* This translates into any dialect */ @Support public static Field timestampAdd(Timestamp date, Field interval, DatePart datePart) { return new DateAdd(Tools.field(date), nullSafe(interval), datePart); } /** * Add an interval to a timestamp, given a date part. *

* This translates into any dialect */ @Support public static Field timestampAdd(Field date, Number interval, DatePart datePart) { return new DateAdd(nullSafe(date), Tools.field(interval), datePart); } /** * Add an interval to a timestamp, given a date part. *

* This translates into any dialect */ @Support public static Field timestampAdd(Field date, Field interval, DatePart datePart) { return new DateAdd(nullSafe(date), nullSafe(interval), datePart); } /** * Get the timestamp difference as a INTERVAL DAY TO SECOND * type. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field timestampDiff(Timestamp timestamp1, Timestamp timestamp2) { return timestampDiff(Tools.field(timestamp1), Tools.field(timestamp2)); } /** * Get the timestamp difference as a INTERVAL DAY TO SECOND * type. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field timestampDiff(Field timestamp1, Timestamp timestamp2) { return timestampDiff(nullSafe(timestamp1), Tools.field(timestamp2)); } /** * Get the timestamp difference as a INTERVAL DAY TO SECOND * type. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field timestampDiff(Timestamp timestamp1, Field timestamp2) { return timestampDiff(Tools.field(timestamp1), nullSafe(timestamp2)); } /** * Get the timestamp difference as a INTERVAL DAY TO SECOND * type. *

* This translates into any dialect * * @see Field#sub(Field) */ @Support public static Field timestampDiff(Field timestamp1, Field timestamp2) { return new TimestampDiff(nullSafe(timestamp1), nullSafe(timestamp2)); } /** * Truncate a date to the beginning of the day. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(Date date) { return trunc(date, DatePart.DAY); } /** * Truncate a date to a given datepart. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(Date date, DatePart part) { return trunc(Tools.field(date), part); } /** * Truncate a date to the beginning of the day. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(LocalDate date) { return trunc(date, DatePart.DAY); } /** * Truncate a date to a given datepart. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(LocalDate date, DatePart part) { return trunc(Tools.field(date), part); } /** * Truncate a timestamp to the beginning of the day. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(Timestamp timestamp) { return trunc(timestamp, DatePart.DAY); } /** * Truncate a timestamp to a given datepart. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(Timestamp timestamp, DatePart part) { return trunc(Tools.field(timestamp), part); } /** * Truncate a timestamp to the beginning of the day. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(LocalDateTime timestamp) { return trunc(timestamp, DatePart.DAY); } /** * Truncate a timestamp to a given datepart. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(LocalDateTime timestamp, DatePart part) { return trunc(Tools.field(timestamp), part); } /** * Truncate a date or a timestamp to the beginning of the day. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(Field date) { return trunc(date, DatePart.DAY); } /** * Truncate a date or a timestamp to a given datepart. */ @Support({ CUBRID, H2, HSQLDB, POSTGRES }) public static Field trunc(Field date, DatePart part) { return new TruncDate(date, part); } // ------------------------------------------------------------------------- /** * Get the extract(field, datePart) function. *

* This translates into any dialect */ @Support public static Field extract(java.util.Date value, DatePart datePart) { return extract(Tools.field(value), datePart); } /** * Get the extract(field, datePart) function. *

* This translates into any dialect */ @Support public static Field extract(Temporal value, DatePart datePart) { return extract(Tools.field(value), datePart); } /** * Get the extract(field, datePart) function. *

* This translates into any dialect */ @Support public static Field extract(Field field, DatePart datePart) { return new Extract(nullSafe(field), datePart); } /** * Get the year part of a date. *

* This is the same as calling {@link #extract(java.util.Date, DatePart)} * with {@link DatePart#YEAR} */ @Support public static Field year(java.util.Date value) { return extract(value, DatePart.YEAR); } /** * Get the year part of a date. *

* This is the same as calling {@link #extract(Temporal, DatePart)} * with {@link DatePart#YEAR} */ @Support public static Field year(Temporal value) { return extract(value, DatePart.YEAR); } /** * Get the year part of a date. *

* This is the same as calling {@link #extract(Field, DatePart)} * with {@link DatePart#YEAR} */ @Support public static Field year(Field field) { return extract(field, DatePart.YEAR); } /** * Get the month part of a date. *

* This is the same as calling {@link #extract(java.util.Date, DatePart)} * with {@link DatePart#MONTH} */ @Support public static Field month(java.util.Date value) { return extract(value, DatePart.MONTH); } /** * Get the month part of a date. *

* This is the same as calling {@link #extract(Temporal, DatePart)} * with {@link DatePart#MONTH} */ @Support public static Field month(Temporal value) { return extract(value, DatePart.MONTH); } /** * Get the month part of a date. *

* This is the same as calling {@link #extract(Field, DatePart)} * with {@link DatePart#MONTH} */ @Support public static Field month(Field field) { return extract(field, DatePart.MONTH); } /** * Get the day part of a date. *

* This is the same as calling {@link #extract(java.util.Date, DatePart)} * with {@link DatePart#DAY} */ @Support public static Field day(java.util.Date value) { return extract(value, DatePart.DAY); } /** * Get the day part of a date. *

* This is the same as calling {@link #extract(Temporal, DatePart)} * with {@link DatePart#DAY} */ @Support public static Field day(Temporal value) { return extract(value, DatePart.DAY); } /** * Get the day part of a date. *

* This is the same as calling {@link #extract(Field, DatePart)} * with {@link DatePart#DAY} */ @Support public static Field day(Field field) { return extract(field, DatePart.DAY); } /** * Get the hour part of a date. *

* This is the same as calling {@link #extract(java.util.Date, DatePart)} * with {@link DatePart#HOUR} */ @Support public static Field hour(java.util.Date value) { return extract(value, DatePart.HOUR); } /** * Get the hour part of a date. *

* This is the same as calling {@link #extract(Temporal, DatePart)} * with {@link DatePart#HOUR} */ @Support public static Field hour(Temporal value) { return extract(value, DatePart.HOUR); } /** * Get the hour part of a date. *

* This is the same as calling {@link #extract(Field, DatePart)} * with {@link DatePart#HOUR} */ @Support public static Field hour(Field field) { return extract(field, DatePart.HOUR); } /** * Get the minute part of a date. *

* This is the same as calling {@link #extract(java.util.Date, DatePart)} * with {@link DatePart#MINUTE} */ @Support public static Field minute(java.util.Date value) { return extract(value, DatePart.MINUTE); } /** * Get the minute part of a date. *

* This is the same as calling {@link #extract(Temporal, DatePart)} * with {@link DatePart#MINUTE} */ @Support public static Field minute(Temporal value) { return extract(value, DatePart.MINUTE); } /** * Get the minute part of a date. *

* This is the same as calling {@link #extract(Field, DatePart)} * with {@link DatePart#MINUTE} */ @Support public static Field minute(Field field) { return extract(field, DatePart.MINUTE); } /** * Get the second part of a date. *

* This is the same as calling {@link #extract(java.util.Date, DatePart)} * with {@link DatePart#SECOND} */ @Support public static Field second(java.util.Date value) { return extract(value, DatePart.SECOND); } /** * Get the second part of a date. *

* This is the same as calling {@link #extract(Temporal, DatePart)} * with {@link DatePart#SECOND} */ @Support public static Field second(Temporal value) { return extract(value, DatePart.SECOND); } /** * Get the second part of a date. *

* This is the same as calling {@link #extract(Field, DatePart)} * with {@link DatePart#SECOND} */ @Support public static Field second(Field field) { return extract(field, DatePart.SECOND); } /** * Convert a string value to a DATE. */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field date(String value) { return Tools.field(Convert.convert(value, Date.class), Date.class); } /** * Convert a temporal value to a DATE. */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field date(java.util.Date value) { return date(Tools.field(value)); } /** * Convert a temporal value to a DATE. */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field date(Field field) { return new DateOrTime(field, SQLDataType.DATE); } /** * Convert a string value to a TIME. */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field

* Depending on whether the database preserves the time zone information * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. * {@link SQLDialect#POSTGRES}), the resulting value might be converted to * UTC. Regardless of this fact, the result should be the same * {@link Instant} (in UTC) as the input. */ @Support({ POSTGRES }) public static Field offsetTime(String value) { return Tools.field(Convert.convert(value, OffsetTime.class), OffsetTime.class); } /** * Convert a temporal value to a TIME WITH TIME ZONE. *

* Depending on whether the database preserves the time zone information * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. * {@link SQLDialect#POSTGRES}), the resulting value might be converted to * UTC. Regardless of this fact, the result should be the same * {@link Instant} (in UTC) as the input. */ @Support({ POSTGRES }) public static Field offsetTime(OffsetTime value) { return offsetTime(Tools.field(value)); } /** * Convert a temporal value to a TIME WITH TIME ZONE. *

* Depending on whether the database preserves the time zone information * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. * {@link SQLDialect#POSTGRES}), the resulting value might be converted to * UTC. Regardless of this fact, the result should be the same * {@link Instant} (in UTC) as the input. */ @Support({ POSTGRES }) public static Field offsetTime(Field field) { return new DateOrTime(field, SQLDataType.OFFSETTIME); } /** * Convert a string value to a TIMESTAMP WITH TIME ZONE. *

* Depending on whether the database preserves the time zone information * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. * {@link SQLDialect#POSTGRES}), the resulting value might be converted to * UTC. Regardless of this fact, the result should be the same * {@link Instant} (in UTC) as the input. */ @Support({ POSTGRES }) public static Field offsetDateTime(String value) { return Tools.field(Convert.convert(value, OffsetDateTime.class), OffsetDateTime.class); } /** * Convert a temporal value to a TIMESTAMP WITH TIME ZONE. *

* Depending on whether the database preserves the time zone information * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. * {@link SQLDialect#POSTGRES}), the resulting value might be converted to * UTC. Regardless of this fact, the result should be the same * {@link Instant} (in UTC) as the input. */ @Support({ POSTGRES }) public static Field offsetDateTime(OffsetDateTime value) { return offsetDateTime(Tools.field(value)); } /** * Convert a temporal value to a TIMESTAMP WITH TIME ZONE. *

* Depending on whether the database preserves the time zone information * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. * {@link SQLDialect#POSTGRES}), the resulting value might be converted to * UTC. Regardless of this fact, the result should be the same * {@link Instant} (in UTC) as the input. */ @Support({ POSTGRES }) public static Field offsetDateTime(Field field) { return new DateOrTime(field, SQLDataType.OFFSETDATETIME); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toDate(String value, String format) { return toDate(Tools.field(value, SQLDataType.VARCHAR), Tools.field(format, SQLDataType.VARCHAR)); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toDate(String value, Field format) { return toDate(Tools.field(value, SQLDataType.VARCHAR), nullSafe(format)); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toDate(Field value, String format) { return toDate(nullSafe(value), Tools.field(format, SQLDataType.VARCHAR)); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toDate(Field value, Field format) { return DSL.field("{to_date}({0}, {1})", SQLDataType.DATE, nullSafe(value), nullSafe(format)); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toTimestamp(String value, String format) { return toTimestamp(Tools.field(value, SQLDataType.VARCHAR), Tools.field(format, SQLDataType.VARCHAR)); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toTimestamp(String value, Field format) { return toTimestamp(Tools.field(value, SQLDataType.VARCHAR), nullSafe(format)); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toTimestamp(Field value, String format) { return toTimestamp(nullSafe(value), Tools.field(format, SQLDataType.VARCHAR)); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toTimestamp(Field value, Field format) { return DSL.field("{to_timestamp}({0}, {1})", SQLDataType.TIMESTAMP, nullSafe(value), nullSafe(format)); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDate(String value, String format) { return toDate(value, format).coerce(SQLDataType.LOCALDATE); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDate(String value, Field format) { return toDate(value, format).coerce(SQLDataType.LOCALDATE); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDate(Field value, String format) { return toDate(value, format).coerce(SQLDataType.LOCALDATE); } /** * Parse a value to a DATE. * * @param value The formatted DATE value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDate(Field value, Field format) { return toDate(value, format).coerce(SQLDataType.LOCALDATE); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDateTime(String value, String format) { return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDateTime(String value, Field format) { return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDateTime(Field value, String format) { return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME); } /** * Parse a value to a TIMESTAMP. * * @param value The formatted TIMESTAMP value. * @param format The vendor-specific formatting string. */ @Support({ H2, HSQLDB, POSTGRES }) public static Field toLocalDateTime(Field value, Field format) { return toTimestamp(value, format).coerce(SQLDataType.LOCALDATETIME); } // ------------------------------------------------------------------------ // XXX Construction of GROUPING SET functions // ------------------------------------------------------------------------ /** * Create a ROLLUP(field1, field2, .., fieldn) grouping field. * * @see #rollup(FieldOrRow...) */ @Support({ CUBRID, MARIADB, MYSQL, POSTGRES_9_5 }) public static GroupField rollup(Field... fields) { return rollup((FieldOrRow[]) nullSafe(fields)); } /** * Create a ROLLUP(field1, field2, .., fieldn) grouping field. *

* This has been observed to work with the following databases: *

    *
  • CUBRID (emulated using the GROUP BY .. WITH ROLLUP clause)
  • *
  • DB2
  • *
  • MySQL (emulated using the GROUP BY .. WITH ROLLUP clause)
  • *
  • Oracle
  • *
  • PostgreSQL 9.5
  • *
  • SQL Server
  • *
  • Sybase SQL Anywhere
  • *
*

* Please check the SQL Server documentation for a very nice explanation of * CUBE, ROLLUP, and GROUPING SETS * clauses in grouping contexts: http://msdn.microsoft.com/en-US/library/bb522495.aspx * * @param fields The fields that are part of the ROLLUP * function * @return A field to be used in a GROUP BY clause */ @Support({ CUBRID, MARIADB, MYSQL, POSTGRES_9_5 }) public static GroupField rollup(FieldOrRow... fields) { return new Rollup(fields); } /** * Create a CUBE(field1, field2, .., fieldn) grouping field. * * @see #cube(Field...) */ @Support({ POSTGRES_9_5 }) public static GroupField cube(Field... fields) { return cube((FieldOrRow[]) nullSafe(fields)); } /** * Create a CUBE(field1, field2, .., fieldn) grouping field. *

* This has been observed to work with the following databases: *

    *
  • DB2
  • *
  • Oracle
  • *
  • PostgreSQL 9.5
  • *
  • SQL Server
  • *
  • Sybase SQL Anywhere
  • *
*

* Please check the SQL Server documentation for a very nice explanation of * CUBE, ROLLUP, and GROUPING SETS * clauses in grouping contexts: http://msdn.microsoft.com/en-US/library/bb522495.aspx * * @param fields The fields that are part of the CUBE * function * @return A field to be used in a GROUP BY clause */ @Support({ POSTGRES_9_5 }) public static GroupField cube(FieldOrRow... fields) { return field("{cube}({0})", Object.class, new QueryPartList(fields)); } /** * Create a GROUPING SETS(field1, field2, .., fieldn) grouping field where * each grouping set only consists of a single field. *

* This has been observed to work with the following databases: *

    *
  • DB2
  • *
  • Oracle
  • *
  • PostgreSQL 9.5
  • *
  • SQL Server
  • *
  • Sybase SQL Anywhere
  • *
*

* Please check the SQL Server documentation for a very nice explanation of * CUBE, ROLLUP, and GROUPING SETS * clauses in grouping contexts: http://msdn.microsoft.com/en-US/library/bb522495.aspx * * @param fields The fields that are part of the GROUPING SETS * function * @return A field to be used in a GROUP BY clause */ @Support({ POSTGRES_9_5 }) public static GroupField groupingSets(Field... fields) { List>[] array = new List[fields.length]; for (int i = 0; i < fields.length; i++) { array[i] = Arrays.>asList(fields[i]); } return groupingSets(array); } /** * Create a GROUPING SETS((field1a, field1b), (field2a), .., (fieldna, * fieldnb)) grouping field. *

* This has been observed to work with the following databases: *

    *
  • DB2
  • *
  • Oracle
  • *
  • PostgreSQL 9.5
  • *
  • SQL Server
  • *
  • Sybase SQL Anywhere
  • *
*

* Please check the SQL Server documentation for a very nice explanation of * CUBE, ROLLUP, and GROUPING SETS * clauses in grouping contexts: http://msdn.microsoft.com/en-US/library/bb522495.aspx * * @param fieldSets The fields that are part of the GROUPING SETS * function * @return A field to be used in a GROUP BY clause */ @Support({ POSTGRES_9_5 }) public static GroupField groupingSets(Field[]... fieldSets) { List>[] array = new List[fieldSets.length]; for (int i = 0; i < fieldSets.length; i++) { array[i] = Arrays.asList(fieldSets[i]); } return groupingSets(array); } /** * Create a GROUPING SETS((field1a, field1b), (field2a), .., (fieldna, * fieldnb)) grouping field. *

* This has been observed to work with the following databases: *

    *
  • DB2
  • *
  • Oracle
  • *
  • PostgreSQL 9.5
  • *
  • SQL Server
  • *
  • Sybase SQL Anywhere
  • *
*

* Please check the SQL Server documentation for a very nice explanation of * CUBE, ROLLUP, and GROUPING SETS * clauses in grouping contexts: http://msdn.microsoft.com/en-US/library/bb522495.aspx * * @param fieldSets The fields that are part of the GROUPING SETS * function * @return A field to be used in a GROUP BY clause */ @Support({ POSTGRES_9_5 }) public static GroupField groupingSets(Collection>... fieldSets) { WrappedList[] array = new WrappedList[fieldSets.length]; for (int i = 0; i < fieldSets.length; i++) { array[i] = new WrappedList(new QueryPartList>(fieldSets[i])); } return new org.jooq.impl.Function("grouping sets", SQLDataType.OTHER, array); } /** * Create a GROUPING(field) aggregation field to be used along with * CUBE, ROLLUP, and GROUPING SETS * groupings. *

* This has been observed to work with the following databases: *

    *
  • DB2
  • *
  • Oracle
  • *
  • PostgreSQL 9.5
  • *
  • SQL Server
  • *
  • Sybase SQL Anywhere
  • *
* * @param field The function argument * @return The GROUPING aggregation field * @see #cube(Field...) * @see #rollup(Field...) */ @Support({ POSTGRES_9_5 }) public static Field grouping(Field field) { return function("grouping", Integer.class, nullSafe(field)); } /** * Create a GROUPING_ID(field1, field2, .., fieldn) aggregation field to be * used along with CUBE, ROLLUP, and * GROUPING SETS groupings. *

* This has been observed to work with the following databases: *

    *
  • Oracle
  • *
  • SQL Server
  • *
* * @param fields The function arguments * @return The GROUPING_ID aggregation field * @see #cube(Field...) * @see #rollup(Field...) */ @Support({}) public static Field groupingId(Field... fields) { return function("grouping_id", Integer.class, nullSafe(fields)); } // ------------------------------------------------------------------------ // XXX Bitwise operations // ------------------------------------------------------------------------ /** * The MySQL BIT_COUNT(field) function, counting the number of * bits that are set in this number. * * @see #bitCount(Field) */ @Support({ CUBRID, FIREBIRD, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitCount(Number value) { return bitCount(Tools.field(value)); } /** * The MySQL BIT_COUNT(field) function, counting the number of * bits that are set in this number. *

* This function is emulated in most other databases like this (for a * TINYINT field):

     * ([field] &   1) +
     * ([field] &   2) >> 1 +
     * ([field] &   4) >> 2 +
     * ([field] &   8) >> 3 +
     * ([field] &  16) >> 4 +
     *  ...
     * ([field] & 128) >> 7
     * 
*

* More efficient algorithms are very welcome */ @Support({ CUBRID, FIREBIRD, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitCount(Field field) { return new BitCount(nullSafe(field)); } /** * The bitwise not operator. * * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNot(T value) { return bitNot(Tools.field(value)); } /** * The bitwise not operator. *

* Most dialects natively support this using ~[field]. jOOQ * emulates this operator in some dialects using -[field] - 1 */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNot(Field field) { return new Neg(nullSafe(field), ExpressionOperator.BIT_NOT); } /** * The bitwise and operator. * * @see #bitAnd(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitAnd(T value1, T value2) { return bitAnd(Tools.field(value1), Tools.field(value2)); } /** * The bitwise and operator. * * @see #bitAnd(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitAnd(T value1, Field value2) { return bitAnd(Tools.field(value1), nullSafe(value2)); } /** * The bitwise and operator. * * @see #bitAnd(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitAnd(Field value1, T value2) { return bitAnd(nullSafe(value1), Tools.field(value2)); } /** * The bitwise and operator. *

* This is not supported by Derby, Ingres *

* This renders the and operation where available: *

[field1] & [field2]
* ... or the and function elsewhere: *
bitand([field1], [field2])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitAnd(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_AND, nullSafe(field1), nullSafe(field2)); } /** * The bitwise not and operator. * * @see #bitNand(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNand(T value1, T value2) { return bitNand(Tools.field(value1), Tools.field(value2)); } /** * The bitwise not and operator. * * @see #bitNand(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNand(T value1, Field value2) { return bitNand(Tools.field(value1), nullSafe(value2)); } /** * The bitwise not and operator. * * @see #bitNand(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNand(Field value1, T value2) { return bitNand(nullSafe(value1), Tools.field(value2)); } /** * The bitwise not and operator. *

* This is not supported by Derby, Ingres *

* This renders the not and operation where available: *

~([field1] & [field2])
* ... or the not and function elsewhere: *
bitnot(bitand([field1], [field2]))
* * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNand(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_NAND, nullSafe(field1), nullSafe(field2)); } /** * The bitwise or operator. * * @see #bitOr(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitOr(T value1, T value2) { return bitOr(Tools.field(value1), Tools.field(value2)); } /** * The bitwise or operator. * * @see #bitOr(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitOr(T value1, Field value2) { return bitOr(Tools.field(value1), nullSafe(value2)); } /** * The bitwise or operator. * * @see #bitOr(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitOr(Field value1, T value2) { return bitOr(nullSafe(value1), Tools.field(value2)); } /** * The bitwise or operator. *

* This is not supported by Derby, Ingres *

* This renders the or operation where available: *

[field1] | [field2]
* ... or the or function elsewhere: *
bitor([field1], [field2])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitOr(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_OR, nullSafe(field1), nullSafe(field2)); } /** * The bitwise not or operator. * * @see #bitNor(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNor(T value1, T value2) { return bitNor(Tools.field(value1), Tools.field(value2)); } /** * The bitwise not or operator. * * @see #bitNor(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNor(T value1, Field value2) { return bitNor(Tools.field(value1), nullSafe(value2)); } /** * The bitwise not or operator. * * @see #bitNor(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNor(Field value1, T value2) { return bitNor(nullSafe(value1), Tools.field(value2)); } /** * The bitwise not or operator. *

* This is not supported by Derby, Ingres *

* This renders the not or operation where available: *

~([field1] | [field2])
* ... or the not or function elsewhere: *
bitnot(bitor([field1], [field2]))
* * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitNor(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_NOR, nullSafe(field1), nullSafe(field2)); } /** * The bitwise xor operator. * * @see #bitXor(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXor(T value1, T value2) { return bitXor(Tools.field(value1), Tools.field(value2)); } /** * The bitwise xor operator. * * @see #bitXor(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXor(T value1, Field value2) { return bitXor(Tools.field(value1), nullSafe(value2)); } /** * The bitwise xor operator. * * @see #bitXor(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXor(Field value1, T value2) { return bitXor(nullSafe(value1), Tools.field(value2)); } /** * The bitwise xor operator. *

* This is not supported by Derby, Ingres *

* This renders the or operation where available: *

[field1] ^ [field2]
* ... or the xor function elsewhere: *
bitxor([field1], [field2])
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXor(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_XOR, nullSafe(field1), nullSafe(field2)); } /** * The bitwise not xor operator. * * @see #bitXNor(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXNor(T value1, T value2) { return bitXNor(Tools.field(value1), Tools.field(value2)); } /** * The bitwise not xor operator. * * @see #bitXNor(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXNor(T value1, Field value2) { return bitXNor(Tools.field(value1), nullSafe(value2)); } /** * The bitwise not xor operator. * * @see #bitXNor(Field, Field) * @see #bitNot(Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXNor(Field value1, T value2) { return bitXNor(nullSafe(value1), Tools.field(value2)); } /** * The bitwise not xor operator. *

* This is not supported by Derby, Ingres *

* This renders the or operation where available: *

~([field1] ^ [field2])
* ... or the not xor function elsewhere: *
bitnot(bitxor([field1], [field2]))
*/ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field bitXNor(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_XNOR, nullSafe(field1), nullSafe(field2)); } /** * The bitwise left shift operator. * * @see #shl(Field, Field) * @see #power(Field, Number) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shl(T value1, Number value2) { return shl(Tools.field(value1), Tools.field(value2)); } /** * The bitwise left shift operator. * * @see #shl(Field, Field) * @see #power(Field, Number) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shl(T value1, Field value2) { return shl(Tools.field(value1), nullSafe(value2)); } /** * The bitwise left shift operator. * * @see #shl(Field, Field) * @see #power(Field, Number) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shl(Field value1, Number value2) { return shl(nullSafe(value1), Tools.field(value2)); } /** * The bitwise left shift operator. *

* Some dialects natively support this using [field1] << [field2]. * jOOQ emulates this operator in some dialects using * [field1] * power(2, [field2]), where power might also be emulated. * * @see #power(Field, Field) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shl(Field field1, Field field2) { return new Expression(ExpressionOperator.SHL, nullSafe(field1), nullSafe(field2)); } /** * The bitwise right shift operator. * * @see #shr(Field, Field) * @see #power(Field, Number) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shr(T value1, Number value2) { return shr(Tools.field(value1), Tools.field(value2)); } /** * The bitwise right shift operator. * * @see #shr(Field, Field) * @see #power(Field, Number) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shr(T value1, Field value2) { return shr(Tools.field(value1), nullSafe(value2)); } /** * The bitwise right shift operator. * * @see #shr(Field, Field) * @see #power(Field, Number) */ @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shr(Field value1, Number value2) { return shr(nullSafe(value1), Tools.field(value2)); } /** * The bitwise right shift operator. *

* Some dialects natively support this using [field1] >> [field2]. * jOOQ emulates this operator in some dialects using * [field1] / power(2, [field2]), where power might also be emulated. * * @see #power(Field, Field) */ @Support({ CUBRID, H2, FIREBIRD, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field shr(Field field1, Field field2) { return new Expression(ExpressionOperator.SHR, nullSafe(field1), nullSafe(field2)); } // ------------------------------------------------------------------------ // XXX Mathematical functions // ------------------------------------------------------------------------ /** * Get the rand() function. */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static Field rand() { return new Rand(); } /** * Find the greatest among all values. *

* This function has no equivalent in Adaptive Server, Derby, SQL Server and * Sybase SQL Anywhere. Its current simulation implementation has * O(2^n) complexity and should be avoided for * n > 5! Better implementation suggestions are very * welcome. * * @see #greatest(Field, Field...) */ @Support public static Field greatest(T value, T... values) { return greatest(Tools.field(value), Tools.fields(values).toArray(EMPTY_FIELD)); } /** * Find the greatest among all values. *

* This function has no equivalent in Adaptive Server, Derby, SQL Server and * Sybase SQL Anywhere. Its current simulation implementation has * O(2^n) complexity and should be avoided for * n > 5! Better implementation suggestions are very * welcome. */ @Support public static Field greatest(Field field, Field... others) { return new Greatest(nullSafeDataType(field), nullSafe(combine(field, others))); } /** * Find the least among all values. *

* This function has no equivalent in Adaptive Server, Derby, SQL Server and * Sybase SQL Anywhere. Its current simulation implementation has * O(2^n) complexity and should be avoided for * n > 5! Better implementation suggestions are very * welcome. * * @see #least(Field, Field...) */ @Support public static Field least(T value, T... values) { return least(Tools.field(value), Tools.fields(values).toArray(EMPTY_FIELD)); } /** * Find the least among all values. *

* This function has no equivalent in Adaptive Server, Derby, SQL Server and * Sybase SQL Anywhere. Its current simulation implementation has * O(2^n) complexity and should be avoided for * n > 5! Better implementation suggestions are very * welcome. */ @Support public static Field least(Field field, Field... others) { return new Least(nullSafeDataType(field), nullSafe(combine(field, others))); } /** * Get the sign of a numeric field: sign(field). * * @see #sign(Field) */ @Support public static Field sign(Number value) { return sign(Tools.field(value)); } /** * Get the sign of a numeric field: sign(field). *

* This renders the sign function where available: *

sign([field])
* ... or emulates it elsewhere (without bind variables on values -1, 0, 1): *
     * CASE WHEN [this] > 0 THEN 1
     *      WHEN [this] < 0 THEN -1
     *      ELSE 0
     * END
     */
    @Support
    public static Field sign(Field field) {
        return new Sign(nullSafe(field));
    }

    /**
     * Get the absolute value of a numeric field: abs(field).
     *
     * @see #abs(Field)
     */
    @Support
    public static  Field abs(T value) {
        return abs(Tools.field(value));
    }

    /**
     * Get the absolute value of a numeric field: abs(field).
     * 

* This renders the same on all dialects: *

abs([field])
*/ @Support public static Field abs(Field field) { return function("abs", nullSafeDataType(field), nullSafe(field)); } /** * Get rounded value of a numeric field: round(field). * * @see #round(Field) */ @Support public static Field round(T value) { return round(Tools.field(value)); } /** * Get rounded value of a numeric field: round(field). *

* This renders the round function where available: *

round([field]) or
     * round([field], 0)
* ... or emulates it elsewhere using floor and ceil */ @Support public static Field round(Field field) { return new Round(nullSafe(field)); } /** * Get rounded value of a numeric field: round(field, decimals). * * @see #round(Field, int) */ @Support public static Field round(T value, int decimals) { return round(Tools.field(value), decimals); } /** * Get rounded value of a numeric field: round(field, decimals). *

* This renders the round function where available: *

round([field], [decimals])
* ... or emulates it elsewhere using floor and ceil */ @Support public static Field round(Field field, int decimals) { return new Round(nullSafe(field), decimals); } /** * Get the largest integer value not greater than [this]. * * @see #floor(Field) */ @Support public static Field floor(T value) { return floor(Tools.field(value)); } /** * Get the largest integer value not greater than [this]. *

* This renders the floor function where available: *

floor([this])
* ... or emulates it elsewhere using round: *
round([this] - 0.499999999999999)
*/ @Support public static Field floor(Field field) { return new Floor(nullSafe(field)); } /** * Get the smallest integer value not less than [this]. * * @see #ceil(Field) */ @Support public static Field ceil(T value) { return ceil(Tools.field(value)); } /** * Get the smallest integer value not less than [field]. *

* This renders the ceil or ceiling function where available: *

ceil([field]) or
     * ceiling([field])
* ... or emulates it elsewhere using round: *
round([field] + 0.499999999999999)
*/ @Support public static Field ceil(Field field) { return new Ceil(nullSafe(field)); } /** * Truncate a number to a given number of decimals. * * @see #trunc(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field trunc(T number) { return trunc(Tools.field(number), inline(0)); } /** * Truncate a number to a given number of decimals. * * @see #trunc(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field trunc(T number, int decimals) { return trunc(Tools.field(number), inline(decimals)); } /** * Truncate a number to a given number of decimals. * * @see #trunc(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field trunc(Field number, int decimals) { return trunc(nullSafe(number), inline(decimals)); } /** * Truncate a number to a given number of decimals. * * @see #trunc(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field trunc(T number, Field decimals) { return trunc(Tools.field(number), nullSafe(decimals)); } /** * Truncate a number to a given number of decimals. *

* This function truncates number to the amount of decimals * specified in decimals. Passing decimals = 0 to * this function is the same as using {@link #floor(Field)}. Passing * positive values for decimal has a similar effect as * {@link #round(Field, int)}. Passing negative values for * decimal will truncate number to a given power * of 10. Some examples *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Function callyields...
trunc(125.815)125
trunc(125.815, 0)125
trunc(125.815, 1)125.8
trunc(125.815, 2)125.81
trunc(125.815, -1)120
trunc(125.815, -2)100
* * @see #trunc(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field trunc(Field number, Field decimals) { return new Trunc(nullSafe(number), nullSafe(decimals)); } /** * Get the sqrt(field) function. * * @see #sqrt(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field sqrt(Number value) { return sqrt(Tools.field(value)); } /** * Get the sqrt(field) function. *

* This renders the sqrt function where available: *

sqrt([field])
... or emulates it elsewhere using * power (which in turn may also be emulated using ln and exp functions): *
power([field], 0.5)
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field sqrt(Field field) { return new Sqrt(nullSafe(field)); } /** * Get the exp(field) function, taking this field as the power of e. * * @see #exp(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field exp(Number value) { return exp(Tools.field(value)); } /** * Get the exp(field) function, taking this field as the power of e. *

* This renders the same on all dialects: *

exp([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field exp(Field field) { return function("exp", SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the ln(field) function, taking the natural logarithm of this field. * * @see #ln(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field ln(Number value) { return ln(Tools.field(value)); } /** * Get the ln(field) function, taking the natural logarithm of this field. *

* This renders the ln or log function where available: *

ln([field]) or
     * log([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field ln(Field field) { return new Ln(nullSafe(field)); } /** * Get the log(field, base) function. * * @see #log(Field, int) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field log(Number value, int base) { return log(Tools.field(value), base); } /** * Get the log(field, base) function. *

* This renders the log function where available: *

log([field])
... or emulates it elsewhere (in * most RDBMS) using the natural logarithm: *
ln([field]) / ln([base])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field log(Field field, int base) { return new Ln(nullSafe(field), base); } /** * Get the power(field, exponent) function. * * @see #power(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field power(Number value, Number exponent) { return power(Tools.field(value), Tools.field(exponent)); } /** * Get the power(field, exponent) function. * * @see #power(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field power(Field field, Number exponent) { return power(nullSafe(field), Tools.field(exponent)); } /** * Get the power(field, exponent) function. * * @see #power(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field power(Number value, Field exponent) { return power(Tools.field(value), nullSafe(exponent)); } /** * Get the power(field, exponent) function. *

* This renders the power function where available: *

power([field], [exponent])
... or emulates it * elsewhere using ln and exp: *
exp(ln([field]) * [exponent])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field power(Field field, Field exponent) { return new Power(nullSafe(field), nullSafe(exponent)); } /** * Get the arc cosine(field) function. * * @see #acos(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field acos(Number value) { return acos(Tools.field(value)); } /** * Get the arc cosine(field) function. *

* This renders the acos function where available: *

acos([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field acos(Field field) { return new Acos(nullSafe(field)); } /** * Get the arc sine(field) function. * * @see #asin(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field asin(Number value) { return asin(Tools.field(value)); } /** * Get the arc sine(field) function. *

* This renders the asin function where available: *

asin([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field asin(Field field) { return new Asin(nullSafe(field)); } /** * Get the arc tangent(field) function. * * @see #atan(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field atan(Number value) { return atan(Tools.field(value)); } /** * Get the arc tangent(field) function. *

* This renders the atan function where available: *

atan([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field atan(Field field) { return new Atan(nullSafe(field)); } /** * Get the atan2(field, y) function. * * @see #atan2(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field atan2(Number x, Number y) { return atan2(Tools.field(x), Tools.field(y)); } /** * Get the atan2(field, y) function. * * @see #atan2(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field atan2(Number x, Field y) { return atan2(Tools.field(x), nullSafe(y)); } /** * Get the atan2(field, y) function. * * @see #atan2(Field, Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field atan2(Field x, Number y) { return atan2(nullSafe(x), Tools.field(y)); } /** * Get the atan2(field, y) function. *

* This renders the atan2 or atn2 function where available: *

atan2([x], [y]) or
     * atn2([x], [y])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field atan2(Field x, Field y) { return new org.jooq.impl.Function(Term.ATAN2, SQLDataType.NUMERIC, nullSafe(x), nullSafe(y)); } /** * Get the cosine(field) function. * * @see #cos(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field cos(Number value) { return cos(Tools.field(value)); } /** * Get the cosine(field) function. *

* This renders the cos function where available: *

cos([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field cos(Field field) { return function("cos", SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the sine(field) function. * * @see #sin(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field sin(Number value) { return sin(Tools.field(value)); } /** * Get the sine(field) function. *

* This renders the sin function where available: *

sin([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field sin(Field field) { return function("sin", SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the tangent(field) function. * * @see #tan(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field tan(Number value) { return tan(Tools.field(value)); } /** * Get the tangent(field) function. *

* This renders the tan function where available: *

tan([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field tan(Field field) { return function("tan", SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the cotangent(field) function. * * @see #cot(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field cot(Number value) { return cot(Tools.field(value)); } /** * Get the cotangent(field) function. *

* This renders the cot function where available: *

cot([field])
... or emulates it elsewhere using * sin and cos:
cos([field]) / sin([field])
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field cot(Field field) { return new Cot(nullSafe(field)); } /** * Get the hyperbolic sine function: sinh(field). * * @see #sinh(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field sinh(Number value) { return sinh(Tools.field(value)); } /** * Get the hyperbolic sine function: sinh(field). *

* This renders the sinh function where available: *

sinh([field])
... or emulates it elsewhere using * exp:
(exp([field] * 2) - 1) / (exp([field] * 2))
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field sinh(Field field) { return new Sinh(nullSafe(field)); } /** * Get the hyperbolic cosine function: cosh(field). * * @see #cosh(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field cosh(Number value) { return cosh(Tools.field(value)); } /** * Get the hyperbolic cosine function: cosh(field). *

* This renders the cosh function where available: *

cosh([field])
... or emulates it elsewhere using * exp:
(exp([field] * 2) + 1) / (exp([field] * 2))
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field cosh(Field field) { return new Cosh(nullSafe(field)); } /** * Get the hyperbolic tangent function: tanh(field). * * @see #tanh(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field tanh(Number value) { return tanh(Tools.field(value)); } /** * Get the hyperbolic tangent function: tanh(field). *

* This renders the tanh function where available: *

tanh([field])
... or emulates it elsewhere using * exp: *
(exp([field] * 2) - 1) / (exp([field] * 2) + 1)
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field tanh(Field field) { return new Tanh(nullSafe(field)); } /** * Get the hyperbolic cotangent function: coth(field). * * @see #coth(Field) */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field coth(Number value) { return coth(Tools.field(value)); } /** * Get the hyperbolic cotangent function: coth(field). *

* This is not supported by any RDBMS, but emulated using exp exp: *

(exp([field] * 2) + 1) / (exp([field] * 2) - 1)
*/ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static Field coth(Field field) { field = nullSafe(field); return exp(field.mul(2)).add(1).div(exp(field.mul(2)).sub(1)); } /** * Calculate degrees from radians from this field. * * @see #deg(Field) */ @Support public static Field deg(Number value) { return deg(Tools.field(value)); } /** * Calculate degrees from radians from this field. *

* This renders the degrees function where available: *

degrees([field])
... or emulates it elsewhere: *
[field] * 180 / PI
*/ @Support public static Field deg(Field field) { return new Degrees(nullSafe(field)); } /** * Calculate radians from degrees from this field. * * @see #rad(Field) */ @Support public static Field rad(Number value) { return rad(Tools.field(value)); } /** * Calculate radians from degrees from this field. *

* This renders the degrees function where available: *

degrees([field])
... or emulates it elsewhere: *
[field] * PI / 180
*/ @Support public static Field rad(Field field) { return new Radians(nullSafe(field)); } // ------------------------------------------------------------------------- // Pseudo-fields and functions for use in the context of a CONNECT BY clause // ------------------------------------------------------------------------- /** * Retrieve the Oracle-specific LEVEL pseudo-field (to be used * along with CONNECT BY clauses). */ @Support({ CUBRID }) public static Field level() { return field("level", Integer.class); } /** * Retrieve the Oracle-specific CONNECT_BY_ISCYCLE pseudo-field * (to be used along with CONNECT BY clauses). */ @Support({ CUBRID }) public static Field connectByIsCycle() { return field("connect_by_iscycle", Boolean.class); } /** * Retrieve the Oracle-specific CONNECT_BY_ISLEAF pseudo-field * (to be used along with CONNECT BY clauses). */ @Support({ CUBRID }) public static Field connectByIsLeaf() { return field("connect_by_isleaf", Boolean.class); } /** * Retrieve the Oracle-specific CONNECT_BY_ROOT pseudo-column * (to be used along with CONNECT BY clauses). */ @Support({ CUBRID }) public static Field connectByRoot(Field field) { return field("{connect_by_root} {0}", nullSafe(field).getDataType(), field); } /** * Retrieve the Oracle-specific * SYS_CONNECT_BY_PATH(field, separator) function (to be used * along with CONNECT BY clauses). */ @Support({ CUBRID }) public static Field sysConnectByPath(Field field, String separator) { return field("{sys_connect_by_path}({0}, {1})", String.class, field, inline(separator)); } /** * Add the Oracle-specific PRIOR unary operator before a field * (to be used along with CONNECT BY clauses). */ @Support({ CUBRID }) public static Field prior(Field field) { return new Prior(field); } // ------------------------------------------------------------------------- // Other pseudo-fields and functions // ------------------------------------------------------------------------- /** * Retrieve the Oracle-specific ROWNUM pseudo-field. */ @Support({ CUBRID }) public static Field rownum() { return field("rownum", Integer.class); } // ------------------------------------------------------------------------- // XXX Aggregate functions // ------------------------------------------------------------------------- /** * Get the count(*) function. */ @Support public static AggregateFunction count() { return count(org.jooq.impl.Function.ASTERISK); } /** * Get the count(field) function. */ @Support public static AggregateFunction count(Field field) { return new org.jooq.impl.Function("count", SQLDataType.INTEGER, nullSafe(field)); } /** * Get the count(table) function. *

* If this is not supported by a given database (i.e. non * {@link SQLDialect#POSTGRES}, then the primary key is used with * {@link #count(Field)}, instead. */ @Support public static AggregateFunction count(Table table) { return new CountTable(table, false); } /** * Get the count(distinct field) function. */ @Support({ CUBRID, DERBY, H2, HSQLDB, FIREBIRD, MARIADB, MYSQL, POSTGRES, SQLITE }) public static AggregateFunction countDistinct(Field field) { return new org.jooq.impl.Function("count", true, SQLDataType.INTEGER, nullSafe(field)); } /** * Get the count(distinct table) function. *

* If this is not supported by a given database (i.e. non * {@link SQLDialect#POSTGRES}, then the primary key is used with * {@link #count(Field)}, instead. */ @Support({ CUBRID, DERBY, H2, HSQLDB, FIREBIRD, MARIADB, MYSQL, POSTGRES, SQLITE }) public static AggregateFunction countDistinct(Table table) { return new CountTable(table, true); } /** * Get the count(distinct field1, field2) function. *

* Some dialects support several expressions in the * COUNT(DISTINCT expr1, expr2) aggregate function. *

* {@link SQLDialect#POSTGRES} supports this as * COUNT(DISTINCT(expr1, expr2)). */ @Support({ HSQLDB, MYSQL, POSTGRES }) public static AggregateFunction countDistinct(Field... fields) { return new org.jooq.impl.Function("count", true, SQLDataType.INTEGER, nullSafe(fields)); } /** * Get the every value over a field: every(field). *

* This is a synonym for {@link #boolAnd(Field)}. */ @Support public static AggregateFunction every(Field field) { return boolAnd(field); } /** * Get the every value over a condition: every(condition). *

* This is a synonym for {@link #boolAnd(Condition)}. */ @Support public static AggregateFunction every(Condition condition) { return boolAnd(condition); } /** * Get the every value over a field: bool_and(field). */ @Support public static AggregateFunction boolAnd(Field field) { return boolAnd(condition(nullSafe(field))); } /** * Get the every value over a condition: bool_and(condition). */ @Support public static AggregateFunction boolAnd(Condition condition) { return new BoolAnd(condition); } /** * Get the every value over a field: bool_and(field). */ @Support public static AggregateFunction boolOr(Field field) { return boolOr(condition(nullSafe(field))); } /** * Get the every value over a condition: bool_and(condition). */ @Support public static AggregateFunction boolOr(Condition condition) { return new BoolOr(condition); } /** * Get the array_agg() aggregate function. */ @Support({ HSQLDB, POSTGRES }) public static ArrayAggOrderByStep arrayAgg(Field field) { return new org.jooq.impl.Function(Term.ARRAY_AGG, field.getDataType().getArrayDataType(), nullSafe(field)); } /** * Create an array literal. *

* This translates to the following databases and syntaxes: *

* * * * * * * * * * * * * * * *
SQLDialectJavaSQL
{@link SQLDialect#H2}array(1, 2)(1, 2)
{@link SQLDialect#HSQLDB}, {@link SQLDialect#POSTGRES}array(1, 2)array[1, 2]
*/ @Support({ H2, HSQLDB, POSTGRES }) public static Field array(T... values) { return array(Tools.fields(values)); } /** * Create an array literal. *

* This translates to the following databases and syntaxes: *

* * * * * * * * * * * * * * * *
SQLDialectJavaSQL
{@link SQLDialect#H2}array(1, 2)(1, 2)
{@link SQLDialect#HSQLDB}, {@link SQLDialect#POSTGRES}array(1, 2)array[1, 2]
*/ @SafeVarargs @Support({ H2, HSQLDB, POSTGRES }) public static Field array(Field... fields) { return array(Arrays.asList(fields)); } /** * Create an array literal. *

* This translates to the following databases and syntaxes: *

* * * * * * * * * * * * * * * *
SQLDialectJavaSQL
{@link SQLDialect#H2}array(1, 2)(1, 2)
{@link SQLDialect#HSQLDB}, {@link SQLDialect#POSTGRES}array(1, 2)array[1, 2]
*/ @Support({ H2, HSQLDB, POSTGRES }) public static Field array(Collection> fields) { return new Array(fields); } /** * Get the max value over a field: max(field). */ @Support public static AggregateFunction max(Field field) { return new org.jooq.impl.Function("max", nullSafeDataType(field), nullSafe(field)); } /** * Get the max value over a field: max(distinct field). */ @Support public static AggregateFunction maxDistinct(Field field) { return new org.jooq.impl.Function("max", true, nullSafeDataType(field), nullSafe(field)); } /** * Get the min value over a field: min(field). */ @Support public static AggregateFunction min(Field field) { return new org.jooq.impl.Function("min", nullSafeDataType(field), nullSafe(field)); } /** * Get the min value over a field: min(distinct field). */ @Support public static AggregateFunction minDistinct(Field field) { return new org.jooq.impl.Function("min", true, nullSafeDataType(field), nullSafe(field)); } /** * Get the sum over a numeric field: sum(field). */ @Support public static AggregateFunction sum(Field field) { return new org.jooq.impl.Function("sum", SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the sum over a numeric field: sum(distinct field). */ @Support public static AggregateFunction sumDistinct(Field field) { return new org.jooq.impl.Function("sum", true, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the average over a numeric field: avg(field). */ @Support public static AggregateFunction avg(Field field) { return new org.jooq.impl.Function("avg", SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the average over a numeric field: avg(distinct field). */ @Support public static AggregateFunction avgDistinct(Field field) { return new org.jooq.impl.Function("avg", true, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the median over a numeric field: median(field). */ @Support({ CUBRID, HSQLDB, POSTGRES_9_4 }) public static AggregateFunction median(Field field) { return new org.jooq.impl.Function(Term.MEDIAN, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the population standard deviation of a numeric field: stddev_pop(field). */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static AggregateFunction stddevPop(Field field) { return new org.jooq.impl.Function(Term.STDDEV_POP, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the sample standard deviation of a numeric field: stddev_samp(field). */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static AggregateFunction stddevSamp(Field field) { return new org.jooq.impl.Function(Term.STDDEV_SAMP, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the population variance of a numeric field: var_pop(field). */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static AggregateFunction varPop(Field field) { return new org.jooq.impl.Function(Term.VAR_POP, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the sample variance of a numeric field: var_samp(field). */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static AggregateFunction varSamp(Field field) { return new org.jooq.impl.Function(Term.VAR_SAMP, SQLDataType.NUMERIC, nullSafe(field)); } /** * Get the REGR_SLOPE linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrSlope(Field y, Field x) { return new org.jooq.impl.Function("regr_slope", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_INTERCEPT linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrIntercept(Field y, Field x) { return new org.jooq.impl.Function("regr_intercept", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_COUNT linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrCount(Field y, Field x) { return new org.jooq.impl.Function("regr_count", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_R2 linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrR2(Field y, Field x) { return new org.jooq.impl.Function("regr_r2", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_AVGX linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrAvgX(Field y, Field x) { return new org.jooq.impl.Function("regr_avgx", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_AVGY linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrAvgY(Field y, Field x) { return new org.jooq.impl.Function("regr_avgy", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_SXX linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrSXX(Field y, Field x) { return new org.jooq.impl.Function("regr_sxx", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_SYY linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrSYY(Field y, Field x) { return new org.jooq.impl.Function("regr_syy", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the REGR_SXY linear regression function. *

* The linear regression functions fit an ordinary-least-squares regression * line to a set of number pairs. You can use them as both aggregate and * window functions, where this is supported. *

* Note that {@link SQLDialect#DB2} does not support linear regression * window functions. */ @Support({ POSTGRES }) public static AggregateFunction regrSXY(Field y, Field x) { return new org.jooq.impl.Function("regr_sxy", SQLDataType.NUMERIC, nullSafe(y), nullSafe(x)); } /** * Get the aggregated concatenation for a field. *

* This is natively supported by {@link SQLDialect#ORACLE11G} upwards. It is * emulated by the following dialects: *

    *
  • {@link SQLDialect#CUBRID}: Using GROUP_CONCAT()
  • *
  • {@link SQLDialect#DB2}: Using XMLAGG()
  • *
  • {@link SQLDialect#H2}: Using GROUP_CONCAT()
  • *
  • {@link SQLDialect#HSQLDB}: Using GROUP_CONCAT()
  • *
  • {@link SQLDialect#MYSQL}: Using GROUP_CONCAT()
  • *
  • {@link SQLDialect#POSTGRES}: Using STRING_AGG()
  • *
  • {@link SQLDialect#SYBASE}: Using LIST()
  • *
* * @see #groupConcat(Field) */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static OrderedAggregateFunction listAgg(Field field) { return new org.jooq.impl.Function(Term.LIST_AGG, SQLDataType.VARCHAR, nullSafe(field)); } /** * Get the aggregated concatenation for a field. *

* This is natively supported by {@link SQLDialect#ORACLE11G} upwards. It is * emulated by the following dialects: *

    *
  • {@link SQLDialect#CUBRID}: Using GROUP_CONCAT
  • *
  • {@link SQLDialect#DB2}: Using XMLAGG()
  • *
  • {@link SQLDialect#H2}: Using GROUP_CONCAT
  • *
  • {@link SQLDialect#HSQLDB}: Using GROUP_CONCAT
  • *
  • {@link SQLDialect#MYSQL}: Using GROUP_CONCAT
  • *
  • {@link SQLDialect#POSTGRES}: Using STRING_AGG()
  • *
  • {@link SQLDialect#SYBASE}: Using LIST()
  • *
* * @see #groupConcat(Field) */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static OrderedAggregateFunction listAgg(Field field, String separator) { return new org.jooq.impl.Function(Term.LIST_AGG, SQLDataType.VARCHAR, nullSafe(field), inline(separator)); } /** * Get the aggregated concatenation for a field. *

* This is natively supported by *

    *
  • {@link SQLDialect#CUBRID}
  • *
  • {@link SQLDialect#H2}
  • *
  • {@link SQLDialect#HSQLDB}
  • *
  • {@link SQLDialect#MYSQL}
  • *
  • {@link SQLDialect#SQLITE} (but without ORDER BY)
  • *
*

* It is emulated by the following dialects: *

    *
  • {@link SQLDialect#DB2}: Using XMLAGG()
  • *
  • {@link SQLDialect#ORACLE}: Using LISTAGG()
  • *
  • {@link SQLDialect#POSTGRES}: Using STRING_AGG()
  • *
  • {@link SQLDialect#SYBASE}: Using LIST()
  • *
* * @see #listAgg(Field) */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static GroupConcatOrderByStep groupConcat(Field field) { return new GroupConcat(nullSafe(field)); } /** * Get the aggregated concatenation for a field. *

* This is natively supported by *

    *
  • {@link SQLDialect#CUBRID}
  • *
  • {@link SQLDialect#H2}
  • *
  • {@link SQLDialect#HSQLDB}
  • *
  • {@link SQLDialect#MYSQL}
  • *
  • {@link SQLDialect#SQLITE}
  • *
*

* It is emulated by the following dialects: *

    *
  • {@link SQLDialect#DB2}: Using XMLAGG()
  • *
  • {@link SQLDialect#ORACLE}: Using LISTAGG()
  • *
  • {@link SQLDialect#POSTGRES}: Using STRING_AGG()
  • *
  • {@link SQLDialect#SYBASE}: Using LIST()
  • *
* * @see #listAgg(Field) */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) public static AggregateFunction groupConcat(Field field, String separator) { return new GroupConcat(nullSafe(field)).separator(separator); } /** * Get the aggregated concatenation for a field. *

* This is natively supported by *

    *
  • {@link SQLDialect#CUBRID}
  • *
  • {@link SQLDialect#H2}
  • *
  • {@link SQLDialect#HSQLDB}
  • *
  • {@link SQLDialect#MYSQL}
  • *
*

* It is emulated by the following dialects: *

    *
  • {@link SQLDialect#SYBASE}: Using LIST()
  • *
  • {@link SQLDialect#POSTGRES}: Using STRING_AGG()
  • *
* * @see #listAgg(Field) */ @Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) public static GroupConcatOrderByStep groupConcatDistinct(Field field) { return new GroupConcat(nullSafe(field), true); } // ------------------------------------------------------------------------- // XXX Ordered-set aggregate functions and hypothetical set functions // ------------------------------------------------------------------------- /** * The mode() within group (oder by [order clause]) ordered * aggregate function. */ @Support(POSTGRES_9_4) public static OrderedAggregateFunctionOfDeferredType mode() { return new Mode(); } /** * The rank(expr) within group (order by [order clause]) * ordered-set aggregate function. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction rank(Field... fields) { return new org.jooq.impl.Function("rank", SQLDataType.INTEGER, fields); } /** * The dense_rank(expr) within group (order by [order clause]) * ordered-set aggregate function. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction denseRank(Field... fields) { return new org.jooq.impl.Function("dense_rank", SQLDataType.INTEGER, fields); } /** * The percent_rank(expr) within group (order by [order clause]) * ordered-set aggregate function. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction percentRank(Field... fields) { return new org.jooq.impl.Function("percent_rank", SQLDataType.INTEGER, fields); } /** * The cume_dist(expr) within group (order by [order clause]) * ordered-set aggregate function. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction cumeDist(Field... fields) { return new org.jooq.impl.Function("cume_dist", SQLDataType.NUMERIC, fields); } /** * The * percentile_cont([number]) within group (order by [column]) * function. *

* While {@link SQLDialect#ORACLE} and {@link SQLDialect#POSTGRES} support * this as an aggregate function, {@link SQLDialect#SQLSERVER} and * {@link SQLDialect#REDSHIFT} support only its window function variant. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction percentileCont(Number number) { return percentileCont(val(number)); } /** * The * percentile_cont([number]) within group (order by [column]) * function. *

* While {@link SQLDialect#ORACLE} and {@link SQLDialect#POSTGRES} support * this as an aggregate function, {@link SQLDialect#SQLSERVER} and * {@link SQLDialect#REDSHIFT} support only its window function variant. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction percentileCont(Field field) { return new org.jooq.impl.Function("percentile_cont", SQLDataType.NUMERIC, nullSafe(field)); } /** * The * percentile_disc([number]) within group (order by [column]) * function. *

* While {@link SQLDialect#ORACLE} and {@link SQLDialect#POSTGRES} support * this as an aggregate function, {@link SQLDialect#SQLSERVER} and * {@link SQLDialect#REDSHIFT} support only its window function variant. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction percentileDisc(Number number) { return percentileDisc(val(number)); } /** * The * percentile_disc([number]) within group (order by [column]) * function. *

* While {@link SQLDialect#ORACLE} and {@link SQLDialect#POSTGRES} support * this as an aggregate function, {@link SQLDialect#SQLSERVER} and * {@link SQLDialect#REDSHIFT} support only its window function variant. */ @Support({ POSTGRES_9_4 }) public static OrderedAggregateFunction percentileDisc(Field field) { return new org.jooq.impl.Function("percentile_disc", SQLDataType.NUMERIC, nullSafe(field)); } // ------------------------------------------------------------------------- // XXX Window clauses // ------------------------------------------------------------------------- /** * Create a {@link WindowSpecification} with a PARTITION BY clause. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowSpecificationOrderByStep partitionBy(Field... fields) { return new WindowSpecificationImpl().partitionBy(fields); } /** * Create a {@link WindowSpecification} with a PARTITION BY clause. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowSpecificationOrderByStep partitionBy(Collection> fields) { return new WindowSpecificationImpl().partitionBy(fields); } /** * Create a {@link WindowSpecification} with an ORDER BY clause. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowSpecificationRowsStep orderBy(Field... fields) { return new WindowSpecificationImpl().orderBy(fields); } /** * Create a {@link WindowSpecification} with an ORDER BY clause. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowSpecificationRowsStep orderBy(SortField... fields) { return new WindowSpecificationImpl().orderBy(fields); } /** * Create a {@link WindowSpecification} with an ORDER BY clause. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowSpecificationRowsStep orderBy(Collection> fields) { return new WindowSpecificationImpl().orderBy(fields); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rowsUnboundedPreceding() { return new WindowSpecificationImpl().rowsUnboundedPreceding(); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rowsPreceding(int number) { return new WindowSpecificationImpl().rowsPreceding(number); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rowsCurrentRow() { return new WindowSpecificationImpl().rowsCurrentRow(); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rowsUnboundedFollowing() { return new WindowSpecificationImpl().rowsUnboundedFollowing(); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rowsFollowing(int number) { return new WindowSpecificationImpl().rowsFollowing(number); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rowsBetweenUnboundedPreceding() { return new WindowSpecificationImpl().rowsBetweenUnboundedPreceding(); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rowsBetweenPreceding(int number) { return new WindowSpecificationImpl().rowsBetweenPreceding(number); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rowsBetweenCurrentRow() { return new WindowSpecificationImpl().rowsBetweenCurrentRow(); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rowsBetweenUnboundedFollowing() { return new WindowSpecificationImpl().rowsBetweenUnboundedFollowing(); } /** * Create a {@link WindowSpecification} with a ROWS clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rowsBetweenFollowing(int number) { return new WindowSpecificationImpl().rowsBetweenFollowing(number); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rangeUnboundedPreceding() { return new WindowSpecificationImpl().rangeUnboundedPreceding(); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rangePreceding(int number) { return new WindowSpecificationImpl().rangePreceding(number); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rangeCurrentRow() { return new WindowSpecificationImpl().rangeCurrentRow(); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rangeUnboundedFollowing() { return new WindowSpecificationImpl().rangeUnboundedFollowing(); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationFinalStep rangeFollowing(int number) { return new WindowSpecificationImpl().rangeFollowing(number); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rangeBetweenUnboundedPreceding() { return new WindowSpecificationImpl().rangeBetweenUnboundedPreceding(); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rangeBetweenPreceding(int number) { return new WindowSpecificationImpl().rangeBetweenPreceding(number); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rangeBetweenCurrentRow() { return new WindowSpecificationImpl().rangeBetweenCurrentRow(); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rangeBetweenUnboundedFollowing() { return new WindowSpecificationImpl().rangeBetweenUnboundedFollowing(); } /** * Create a {@link WindowSpecification} with a RANGE clause. */ @Support({ POSTGRES }) public static WindowSpecificationRowsAndStep rangeBetweenFollowing(int number) { return new WindowSpecificationImpl().rangeBetweenFollowing(number); } // ------------------------------------------------------------------------- // XXX Window functions // ------------------------------------------------------------------------- /** * The row_number() over ([analytic clause]) function. *

* Newer versions of {@link SQLDialect#DERBY} and {@link SQLDialect#H2} also * support the ROW_NUMBER() OVER() window function without any * window clause. See the respective docs for details. * {@link SQLDialect#HSQLDB} can emulate this function using * ROWNUM() */ @Support({ CUBRID, DERBY, FIREBIRD_3_0, H2, HSQLDB, POSTGRES }) public static WindowOverStep rowNumber() { return new org.jooq.impl.Function(ROW_NUMBER, SQLDataType.INTEGER); } /** * The rank() over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowOverStep rank() { return new org.jooq.impl.Function("rank", SQLDataType.INTEGER); } /** * The dense_rank() over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowOverStep denseRank() { return new org.jooq.impl.Function("dense_rank", SQLDataType.INTEGER); } /** * The precent_rank() over ([analytic clause]) function. */ @Support({ CUBRID, POSTGRES }) public static WindowOverStep percentRank() { return new org.jooq.impl.Function("percent_rank", SQLDataType.NUMERIC); } /** * The cume_dist() over ([analytic clause]) function. */ @Support({ CUBRID, POSTGRES }) public static WindowOverStep cumeDist() { return new org.jooq.impl.Function("cume_dist", SQLDataType.NUMERIC); } /** * The ntile([number]) over ([analytic clause]) function. */ @Support({ CUBRID, POSTGRES }) public static WindowOverStep ntile(int number) { return new org.jooq.impl.Function("ntile", SQLDataType.INTEGER, inline(number)); } /** * The ratio_to_report([expression]) over ([analytic clause]) function. */ @Support({ CUBRID, POSTGRES }) public static WindowOverStep ratioToReport(Number number) { return ratioToReport(Tools.field(number)); } /** * The ratio_to_report([expression]) over ([analytic clause]) function. */ @Support({ CUBRID, POSTGRES }) public static WindowOverStep ratioToReport(Field field) { return new RatioToReport(nullSafe(field)); } /** * The first_value(field) over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep firstValue(Field field) { return new org.jooq.impl.Function("first_value", nullSafeDataType(field), nullSafe(field)); } /** * The last_value(field) over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lastValue(Field field) { return new org.jooq.impl.Function("last_value", nullSafeDataType(field), nullSafe(field)); } /** * The nth_value(field) over ([analytic clause]) function. */ @Support({ FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep nthValue(Field field, int nth) { return nthValue(field, val(nth)); } /** * The nth_value(field) over ([analytic clause]) function. */ @Support({ FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep nthValue(Field field, Field nth) { return new org.jooq.impl.Function("nth_value", nullSafeDataType(field), nullSafe(field), nullSafe(nth)); } /** * The lead(field) over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lead(Field field) { return new LeadLag("lead", nullSafe(field)); } /** * The lead(field, offset) over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lead(Field field, int offset) { return new LeadLag("lead", nullSafe(field), offset); } /** * The * lead(field, offset, defaultValue) over ([analytic clause]) * function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lead(Field field, int offset, T defaultValue) { return lead(nullSafe(field), offset, Tools.field(defaultValue)); } /** * The * lead(field, offset, defaultValue) over ([analytic clause]) * function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lead(Field field, int offset, Field defaultValue) { return new LeadLag("lead", nullSafe(field), offset, nullSafe(defaultValue)); } /** * The lag(field) over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lag(Field field) { return new LeadLag("lag", nullSafe(field)); } /** * The lag(field, offset) over ([analytic clause]) function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lag(Field field, int offset) { return new LeadLag("lag", nullSafe(field), offset); } /** * The * lag(field, offset, defaultValue) over ([analytic clause]) * function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lag(Field field, int offset, T defaultValue) { return lag(nullSafe(field), offset, Tools.field(defaultValue)); } /** * The * lag(field, offset, defaultValue) over ([analytic clause]) * function. */ @Support({ CUBRID, FIREBIRD_3_0, POSTGRES }) public static WindowIgnoreNullsStep lag(Field field, int offset, Field defaultValue) { return new LeadLag("lag", nullSafe(field), offset, nullSafe(defaultValue)); } // ------------------------------------------------------------------------- // XXX Bind values // ------------------------------------------------------------------------- /** * Create an unnamed parameter with a generic type ({@link Object} / * {@link SQLDataType#OTHER}) and no initial value. *

* Try to avoid this method when using any of these databases, as these * databases may have trouble inferring the type of the bind value. Use * typed named parameters instead, using {@link #param(Class)} or * {@link #param(DataType)} *

    *
  • {@link SQLDialect#DB2}
  • *
  • {@link SQLDialect#DERBY}
  • *
  • {@link SQLDialect#H2}
  • *
  • {@link SQLDialect#HSQLDB}
  • *
  • {@link SQLDialect#INGRES}
  • *
  • {@link SQLDialect#SYBASE}
  • *
* * @see #param(String, Object) */ @Support public static Param param() { return param(Object.class); } /** * Create an unnamed parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static Param param(Class type) { return param(DefaultDataType.getDataType(null, type)); } /** * Create an unnamed parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static Param param(DataType type) { return new Val(null, type); } /** * Create an unnamed parameter with the defined type of another field and no * initial value. * * @see #param(String, Object) */ @Support public static Param param(Field field) { return param(field.getDataType()); } /** * Create a named parameter with a generic type ({@link Object} / * {@link SQLDataType#OTHER}) and no initial value. *

* Try to avoid this method when using any of these databases, as these * databases may have trouble inferring the type of the bind value. Use * typed named parameters instead, using {@link #param(String, Class)} or * {@link #param(String, DataType)} *

    *
  • {@link SQLDialect#DB2}
  • *
  • {@link SQLDialect#DERBY}
  • *
  • {@link SQLDialect#H2}
  • *
  • {@link SQLDialect#HSQLDB}
  • *
  • {@link SQLDialect#INGRES}
  • *
  • {@link SQLDialect#SYBASE}
  • *
* * @see #param(String, Object) */ @Support public static Param param(String name) { return param(name, Object.class); } /** * Create a named parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static Param param(String name, Class type) { return param(name, DefaultDataType.getDataType(null, type)); } /** * Create a named parameter with a defined type and no initial value. * * @see #param(String, Object) */ @Support public static Param param(String name, DataType type) { return new Val(null, type, name); } /** * Create a named parameter with a defined type of another field and no * initial value. * * @see #param(String, Object) */ @Support public static Param param(String name, Field type) { return param(name, type.getDataType()); } /** * Create a named parameter with an initial value. *

* Named parameters are useful for several use-cases: *

    *
  • They can be used with Spring's JdbcTemplate, which * supports named parameters. Use * {@link DSLContext#renderNamedParams(QueryPart)} to render * parameter names in SQL
  • *
  • Named parameters can be retrieved using a well-known name from * {@link Query#getParam(String)} and {@link Query#getParams()}.
  • *
* * @see Query#getParam(String) * @see Query#getParams() * @see DSLContext#renderNamedParams(QueryPart) */ @Support public static Param param(String name, T value) { return new Val(value, Tools.field(value).getDataType(), name); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ @Support public static Param value(T value) { return val(value); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(byte value) { return value((Object) value, SQLDataType.TINYINT); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Byte value) { return value((Object) value, SQLDataType.TINYINT); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(UByte value) { return value((Object) value, SQLDataType.TINYINTUNSIGNED); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(short value) { return value((Object) value, SQLDataType.SMALLINT); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Short value) { return value((Object) value, SQLDataType.SMALLINT); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(UShort value) { return value((Object) value, SQLDataType.SMALLINTUNSIGNED); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(int value) { return value((Object) value, SQLDataType.INTEGER); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Integer value) { return value((Object) value, SQLDataType.INTEGER); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(UInteger value) { return value((Object) value, SQLDataType.INTEGERUNSIGNED); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(long value) { return value((Object) value, SQLDataType.BIGINT); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Long value) { return value((Object) value, SQLDataType.BIGINT); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(ULong value) { return value((Object) value, SQLDataType.BIGINTUNSIGNED); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(float value) { return value((Object) value, SQLDataType.REAL); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Float value) { return value((Object) value, SQLDataType.REAL); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(double value) { return value((Object) value, SQLDataType.DOUBLE); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Double value) { return value((Object) value, SQLDataType.DOUBLE); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(boolean value) { return value((Object) value, SQLDataType.BOOLEAN); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Boolean value) { return value((Object) value, SQLDataType.BOOLEAN); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(BigDecimal value) { return value((Object) value, SQLDataType.DECIMAL); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(BigInteger value) { return value((Object) value, SQLDataType.DECIMAL_INTEGER); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(byte[] value) { return value((Object) value, SQLDataType.VARBINARY); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(String value) { return value((Object) value, SQLDataType.VARCHAR); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param value(Date value) { return value((Object) value, SQLDataType.DATE); } /** * A synonym for {@link #val(Object)} to be used in Scala and Groovy, where * val is a reserved keyword. * * @see #val(Object) */ public static Param