[jOOQ/jOOQ#11578] Add DSL.inlined(Field<T>): Field<T>
This commit is contained in:
parent
b814d3a7bd
commit
ce4e0cef90
@ -92,6 +92,7 @@ import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.conf.ParamType.INLINED;
|
||||
import static org.jooq.impl.Keywords.K_CUBE;
|
||||
import static org.jooq.impl.Keywords.K_DEFAULT;
|
||||
import static org.jooq.impl.Keywords.K_GROUPING_SETS;
|
||||
@ -406,6 +407,7 @@ import org.jooq.XMLAttributes;
|
||||
import org.jooq.XMLExistsPassingStep;
|
||||
import org.jooq.XMLQueryPassingStep;
|
||||
import org.jooq.XMLTablePassingStep;
|
||||
import org.jooq.conf.ParamType;
|
||||
import org.jooq.conf.Settings;
|
||||
import org.jooq.exception.SQLDialectNotSupportedException;
|
||||
import org.jooq.impl.XMLParse.DocumentOrContent;
|
||||
@ -25014,6 +25016,46 @@ public class DSL {
|
||||
return val(value, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inline all bind variables produced by the argument {@link Field}.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static <T> Field<T> inlined(Field<T> field) {
|
||||
return CustomField.of(field.getQualifiedName(), field.getDataType(), c -> c.visit(field, INLINED));
|
||||
}
|
||||
|
||||
/**
|
||||
* Inline all bind variables produced by the argument {@link Condition}.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Condition inlined(Condition condition) {
|
||||
return CustomCondition.of(c -> c.visit(condition, INLINED));
|
||||
}
|
||||
|
||||
/**
|
||||
* Inline all bind variables produced by the argument {@link QueryPart}.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static QueryPart inlined(QueryPart part) {
|
||||
return CustomQueryPart.of(c -> c.visit(part, INLINED));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a bind value, that is always inlined.
|
||||
* <p>
|
||||
|
||||
@ -61,6 +61,7 @@ import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.function;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.inlined;
|
||||
import static org.jooq.impl.DSL.keyword;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.DSL.val;
|
||||
@ -647,6 +648,9 @@ final class Expression<T> extends AbstractTransformable<T> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -41,12 +41,12 @@ package org.jooq.impl;
|
||||
import static org.jooq.impl.DSL.NULL;
|
||||
import static org.jooq.impl.DSL.coalesce;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inlined;
|
||||
import static org.jooq.impl.Keywords.K_FORMAT;
|
||||
import static org.jooq.impl.Keywords.K_JSON;
|
||||
import static org.jooq.impl.Keywords.K_KEY;
|
||||
import static org.jooq.impl.Keywords.K_VALUE;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
import static org.jooq.impl.Tools.inlined;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
|
||||
@ -39,6 +39,7 @@ package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
import static org.jooq.conf.ParamType.INLINED;
|
||||
import static org.jooq.impl.DSL.inlined;
|
||||
import static org.jooq.impl.JSONValue.Behaviour.DEFAULT;
|
||||
import static org.jooq.impl.JSONValue.Behaviour.ERROR;
|
||||
import static org.jooq.impl.JSONValue.Behaviour.NULL;
|
||||
@ -50,7 +51,6 @@ import static org.jooq.impl.Names.N_JSON_EXTRACT;
|
||||
import static org.jooq.impl.Names.N_JSON_VALUE;
|
||||
import static org.jooq.impl.SQLDataType.JSONB;
|
||||
import static org.jooq.impl.Tools.castIfNeeded;
|
||||
import static org.jooq.impl.Tools.inlined;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ final class Keywords {
|
||||
static final Keyword K_DAY = keyword("day");
|
||||
static final Keyword K_DAY_MICROSECOND = keyword("day_microsecond");
|
||||
static final Keyword K_DAY_MILLISECOND = keyword("day_millisecond");
|
||||
static final Keyword K_DAY_TO_SECOND = keyword("day_to_second");
|
||||
static final Keyword K_DAY_TO_SECOND = keyword("day to second");
|
||||
static final Keyword K_DECIMAL = keyword("decimal");
|
||||
static final Keyword K_DECLARE = keyword("declare");
|
||||
static final Keyword K_DEFAULT = keyword("default");
|
||||
|
||||
@ -37,17 +37,15 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
import static org.jooq.conf.ParamType.INLINED;
|
||||
import static org.jooq.impl.DSL.inlined;
|
||||
import static org.jooq.impl.Keywords.K_COALESCE;
|
||||
import static org.jooq.impl.PositionalWindowFunction.PositionalFunctionType.LAG;
|
||||
import static org.jooq.impl.PositionalWindowFunction.PositionalFunctionType.LEAD;
|
||||
import static org.jooq.impl.Tools.inlined;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.conf.ParamType;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
|
||||
@ -1959,10 +1959,6 @@ final class Tools {
|
||||
return result;
|
||||
}
|
||||
|
||||
static final <T> Field<T> inlined(Field<T> field) {
|
||||
return CustomField.of(field.getQualifiedName(), field.getDataType(), c -> c.visit(field, INLINED));
|
||||
}
|
||||
|
||||
static final IllegalArgumentException indexFail(Row row, Field<?> field) {
|
||||
return new IllegalArgumentException("Field (" + field + ") is not contained in Row " + row);
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ package org.jooq.impl;
|
||||
import static org.jooq.conf.ParamType.INLINED;
|
||||
import static org.jooq.impl.DSL.cast;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.inlined;
|
||||
import static org.jooq.impl.DSL.rowNumber;
|
||||
import static org.jooq.impl.DSL.select;
|
||||
import static org.jooq.impl.DSL.table;
|
||||
@ -56,7 +57,6 @@ import static org.jooq.impl.Keywords.K_VALUE;
|
||||
import static org.jooq.impl.Keywords.K_XMLTABLE;
|
||||
import static org.jooq.impl.Names.N_XMLTABLE;
|
||||
import static org.jooq.impl.SQLDataType.XML;
|
||||
import static org.jooq.impl.Tools.inlined;
|
||||
import static org.jooq.impl.Tools.visitSubquery;
|
||||
import static org.jooq.impl.XMLPassingMechanism.BY_REF;
|
||||
import static org.jooq.impl.XMLPassingMechanism.BY_VALUE;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user