Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2009-2014, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* This work is dual-licensed
* - under the Apache Software License 2.0 (the "ASL")
* - under the jOOQ License and Maintenance Agreement (the "jOOQ License")
* =============================================================================
* You may choose which license applies to you:
*
* - If you're using this work with Open Source databases, you may choose
* either ASL or jOOQ License.
* - If you're using this work with at least one commercial database, you must
* choose jOOQ License
*
* For more information, please visit http://www.jooq.org/licenses
*
* Apache Software License 2.0:
* -----------------------------------------------------------------------------
* 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.
*
* jOOQ License and Maintenance Agreement:
* -----------------------------------------------------------------------------
* Data Geekery grants the Customer the non-exclusive, timely limited and
* non-transferable license to install and use the Software under the terms of
* the jOOQ License and Maintenance Agreement.
*
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
*/
package org.jooq.impl;
import static java.util.Arrays.asList;
import static org.jooq.Clause.WITH;
// ...
// ...
// ...
import static org.jooq.impl.DSL.count;
import static org.jooq.impl.DSL.name;
import static org.jooq.impl.DSL.one;
import static org.jooq.impl.DSL.zero;
import java.util.Arrays;
import java.util.Collection;
import javax.annotation.Generated;
import org.jooq.Clause;
import org.jooq.CommonTableExpression;
import org.jooq.Configuration;
import org.jooq.Context;
import org.jooq.DeleteWhereStep;
import org.jooq.Field;
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.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.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.Select;
import org.jooq.SelectSelectStep;
import org.jooq.SelectWhereStep;
import org.jooq.Table;
import org.jooq.UpdateSetFirstStep;
import org.jooq.WithAsStep;
import org.jooq.WithStep;
/**
* This type models an intermediary DSL construction step, which leads towards
* creating any of the other 5 DML statement types.
*
* @author Lukas Eder
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
class WithImpl extends AbstractQueryPart implements WithStep, WithAsStep {
/**
* Generated UID
*/
private static final long serialVersionUID = -1813359431778402705L;
private static final Clause[] CLAUSES = { WITH };
private final CommonTableExpressionList cte;
private final boolean recursive;
private Configuration configuration;
// Intermediary properties for CTE construction
private String alias;
private String[] fieldAliases;
WithImpl(Configuration configuration, boolean recursive) {
this.configuration = configuration;
this.recursive = recursive;
this.cte = new CommonTableExpressionList();
}
// -------------------------------------------------------------------------
// XXX QueryPart API
// -------------------------------------------------------------------------
@Override
public final void accept(Context> ctx) {
ctx.keyword("with")
.sql(" ");
if (recursive && !asList().contains(ctx.configuration().dialect().family()))
ctx.keyword("recursive")
.sql(" ");
ctx.declareCTE(true)
.visit(cte)
.declareCTE(false);
}
@Override
public final Clause[] clauses(Context> ctx) {
return CLAUSES;
}
// -------------------------------------------------------------------------
// XXX With API
// -------------------------------------------------------------------------
@Override
public final WithStep as(Select> select) {
cte.add(name(alias).fields(fieldAliases).as(select));
this.alias = null;
this.fieldAliases = null;
return this;
}
@Override
public final WithAsStep with(String a) {
return with(a, new String[0]);
}
@Override
public final WithAsStep with(String a, String... f) {
this.alias = a;
this.fieldAliases = f;
return this;
}
@Override
public final WithStep with(CommonTableExpression>... tables) {
for (CommonTableExpression> table : tables)
cte.add(table);
return this;
}
@Override
public final SelectWhereStep selectFrom(Table table) {
return new SelectImpl(this, configuration).from(table);
}
@Override
public final SelectSelectStep select(Collection extends Field>> fields) {
return new SelectImpl(this, configuration).select(fields);
}
@Override
public final SelectSelectStep select(Field>... fields) {
return new SelectImpl(this, configuration).select(fields);
}
// [jooq-tools] START [select]
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1) {
return (SelectSelectStep) select(new Field[] { field1 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2) {
return (SelectSelectStep) select(new Field[] { field1, field2 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11) {
return (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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 (SelectSelectStep) select(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 });
}
@Generated("This method was generated using jOOQ-tools")
@Override
public SelectSelectStep> select(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