[jOOQ/jOOQ#15623] Stop using deprecated DSL API in jOOQ-meta
This commit is contained in:
parent
41505e01db
commit
402236b25a
@ -43,7 +43,6 @@ import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.emptyList;
|
||||
import static java.util.Comparator.comparing;
|
||||
import static java.util.stream.Collectors.groupingBy;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static org.jooq.Log.Level.ERROR;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.CUBRID;
|
||||
@ -82,7 +81,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@ -94,7 +92,6 @@ import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.jooq.Condition;
|
||||
@ -112,14 +109,12 @@ import org.jooq.Parser;
|
||||
// ...
|
||||
import org.jooq.Query;
|
||||
import org.jooq.Record;
|
||||
// ...
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Select;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.TableOptions.TableType;
|
||||
// ...
|
||||
import org.jooq.conf.ParseWithMetaLookups;
|
||||
import org.jooq.conf.RenderQuotedNames;
|
||||
import org.jooq.exception.DataAccessException;
|
||||
|
||||
@ -51,8 +51,6 @@ import java.util.regex.Pattern;
|
||||
|
||||
import org.jooq.DataType;
|
||||
// ...
|
||||
import org.jooq.exception.SQLDialectNotSupportedException;
|
||||
import org.jooq.impl.DefaultDataType;
|
||||
import org.jooq.impl.ParserException;
|
||||
import org.jooq.impl.SQLDataType;
|
||||
import org.jooq.meta.jaxb.SyntheticColumnType;
|
||||
|
||||
@ -40,7 +40,6 @@ package org.jooq.meta;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -41,7 +41,6 @@ package org.jooq.meta;
|
||||
import static java.lang.Boolean.FALSE;
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static org.jooq.tools.Convert.convert;
|
||||
import static org.jooq.tools.StringUtils.isBlank;
|
||||
import static org.jooq.tools.StringUtils.isEmpty;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -56,11 +55,9 @@ import org.jooq.Converter;
|
||||
import org.jooq.DataType;
|
||||
import org.jooq.GeneratorStatementType;
|
||||
import org.jooq.Name;
|
||||
// ...
|
||||
import org.jooq.exception.SQLDialectNotSupportedException;
|
||||
// ...
|
||||
import org.jooq.impl.AutoConverter;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.DateAsTimestampBinding;
|
||||
import org.jooq.impl.DefaultDataType;
|
||||
import org.jooq.impl.EnumConverter;
|
||||
@ -70,7 +67,6 @@ import org.jooq.impl.XMLtoJAXBConverter;
|
||||
import org.jooq.meta.jaxb.CustomType;
|
||||
import org.jooq.meta.jaxb.ForcedType;
|
||||
import org.jooq.meta.jaxb.LambdaConverter;
|
||||
import org.jooq.meta.jaxb.SyntheticEnumType;
|
||||
import org.jooq.tools.JooqLogger;
|
||||
import org.jooq.tools.StringUtils;
|
||||
|
||||
@ -84,7 +80,6 @@ public abstract class AbstractTypedElementDefinition<T extends Definition>
|
||||
private final T container;
|
||||
private final DataTypeDefinition definedType;
|
||||
private transient DataTypeDefinition type;
|
||||
private transient DataTypeDefinition resolvedType;
|
||||
|
||||
public AbstractTypedElementDefinition(T container, String name, int position, DataTypeDefinition definedType, String comment) {
|
||||
this(container, name, position, definedType, comment, null);
|
||||
|
||||
@ -40,7 +40,6 @@ package org.jooq.meta;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.jooq.tools.StringUtils;
|
||||
|
||||
@ -39,8 +39,6 @@ package org.jooq.meta;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jooq.Name;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
|
||||
@ -40,7 +40,6 @@ package org.jooq.meta;
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
@ -63,5 +63,6 @@ public interface ParameterDefinition extends TypedElementDefinition<RoutineDefin
|
||||
/**
|
||||
* Whether the parameter is synthetic.
|
||||
*/
|
||||
@Override
|
||||
boolean isSynthetic();
|
||||
}
|
||||
|
||||
@ -40,7 +40,6 @@ package org.jooq.meta;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.jooq.tools.StringUtils;
|
||||
|
||||
@ -59,7 +59,6 @@ import org.jooq.Condition;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record3;
|
||||
import org.jooq.Records;
|
||||
import org.jooq.Result;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
@ -40,9 +40,9 @@ package org.jooq.meta.duckdb;
|
||||
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.table;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.meta.duckdb.system.main.Tables.*;
|
||||
import static org.jooq.meta.duckdb.system.main.Tables.DUCKDB_COLUMNS;
|
||||
import static org.jooq.meta.duckdb.system.main.Tables.DUCKDB_TYPES;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
package org.jooq.meta.duckdb;
|
||||
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.meta.duckdb.system.main.Tables.DUCKDB_COLUMNS;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@ -47,7 +48,6 @@ import java.util.Random;
|
||||
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.impl.DefaultDataType;
|
||||
import org.jooq.impl.QOM;
|
||||
import org.jooq.meta.AbstractUDTDefinition;
|
||||
@ -57,7 +57,6 @@ import org.jooq.meta.DefaultAttributeDefinition;
|
||||
import org.jooq.meta.DefaultDataTypeDefinition;
|
||||
import org.jooq.meta.RoutineDefinition;
|
||||
import org.jooq.meta.SchemaDefinition;
|
||||
import static org.jooq.meta.duckdb.system.main.Tables.*;
|
||||
|
||||
public class DuckDBUDTDefinition extends AbstractUDTDefinition {
|
||||
|
||||
|
||||
@ -568,7 +568,7 @@ public class FirebirdDatabase extends AbstractDatabase implements ResultQueryDat
|
||||
.where(p.RDB$PROCEDURE_TYPE.eq((short) 2))
|
||||
.union(is30()
|
||||
? select(
|
||||
fu.RDB$FUNCTION_NAME.trim(),
|
||||
trim(fu.RDB$FUNCTION_NAME),
|
||||
FIELD_TYPE(fi).as("t"),
|
||||
coalesce(CHARACTER_LENGTH(fi), fi.RDB$FIELD_PRECISION).as("p"),
|
||||
FIELD_SCALE(fi).as("s"))
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.meta.firebird;
|
||||
|
||||
import static org.jooq.impl.DSL.bitOr;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.trim;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.CHARACTER_LENGTH;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.FIELD_SCALE;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.FIELD_TYPE;
|
||||
@ -48,7 +51,6 @@ import static org.jooq.meta.firebird.rdb.Tables.RDB$PROCEDURE_PARAMETERS;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.jooq.Record;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractRoutineDefinition;
|
||||
import org.jooq.meta.DataTypeDefinition;
|
||||
import org.jooq.meta.DefaultDataTypeDefinition;
|
||||
@ -101,12 +103,12 @@ public class FirebirdRoutineDefinition extends AbstractRoutineDefinition {
|
||||
.select(
|
||||
p.RDB$PARAMETER_NUMBER,
|
||||
p.RDB$PARAMETER_TYPE,
|
||||
p.RDB$PARAMETER_NAME.trim().as(p.RDB$PARAMETER_NAME),
|
||||
trim(p.RDB$PARAMETER_NAME).as(p.RDB$PARAMETER_NAME),
|
||||
FIELD_TYPE(f).as("FIELD_TYPE"),
|
||||
CHARACTER_LENGTH(f).as("CHAR_LEN"),
|
||||
f.RDB$FIELD_PRECISION,
|
||||
FIELD_SCALE(f).as("FIELD_SCALE"),
|
||||
DSL.bitOr(p.RDB$NULL_FLAG.nvl((short) 0), f.RDB$NULL_FLAG.nvl((short) 0)).as(p.RDB$NULL_FLAG),
|
||||
bitOr(nvl(p.RDB$NULL_FLAG, inline((short) 0)), nvl(f.RDB$NULL_FLAG, inline((short) 0))).as(p.RDB$NULL_FLAG),
|
||||
p.RDB$DEFAULT_SOURCE)
|
||||
.from(p)
|
||||
.leftOuterJoin(f).on(p.RDB$FIELD_SOURCE.eq(f.RDB$FIELD_NAME))
|
||||
@ -118,12 +120,12 @@ public class FirebirdRoutineDefinition extends AbstractRoutineDefinition {
|
||||
.select(
|
||||
a.RDB$ARGUMENT_POSITION.as(p.RDB$PARAMETER_NUMBER),
|
||||
inline(0).as(p.RDB$PARAMETER_TYPE),
|
||||
a.RDB$ARGUMENT_NAME.trim().as(p.RDB$PARAMETER_NAME),
|
||||
trim(a.RDB$ARGUMENT_NAME).as(p.RDB$PARAMETER_NAME),
|
||||
FIELD_TYPE(f).as("FIELD_TYPE"),
|
||||
CHARACTER_LENGTH(f).as("CHAR_LEN"),
|
||||
f.RDB$FIELD_PRECISION,
|
||||
FIELD_SCALE(f).as("FIELD_SCALE"),
|
||||
DSL.bitOr(a.RDB$NULL_FLAG.nvl((short) 0), f.RDB$NULL_FLAG.nvl((short) 0)).as(p.RDB$NULL_FLAG),
|
||||
bitOr(nvl(a.RDB$NULL_FLAG, inline((short) 0)), nvl(f.RDB$NULL_FLAG, inline((short) 0))).as(p.RDB$NULL_FLAG),
|
||||
a.RDB$DEFAULT_SOURCE)
|
||||
.from(a)
|
||||
.leftOuterJoin(f).on(a.RDB$FIELD_SOURCE.eq(f.RDB$FIELD_NAME))
|
||||
|
||||
@ -37,7 +37,9 @@
|
||||
*/
|
||||
package org.jooq.meta.firebird;
|
||||
|
||||
import static org.jooq.impl.DSL.bitOr;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.trim;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.CHARACTER_LENGTH;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.FIELD_SCALE;
|
||||
@ -90,7 +92,7 @@ public class FirebirdTableDefinition extends AbstractTableDefinition {
|
||||
trim(r.RDB$FIELD_NAME).as(r.RDB$FIELD_NAME),
|
||||
r.RDB$DESCRIPTION,
|
||||
r.RDB$DEFAULT_VALUE,
|
||||
DSL.bitOr(r.RDB$NULL_FLAG.nvl(inline((short) 0)), f.RDB$NULL_FLAG.nvl(inline((short) 0))).as(r.RDB$NULL_FLAG),
|
||||
bitOr(nvl(r.RDB$NULL_FLAG, inline((short) 0)), nvl(f.RDB$NULL_FLAG, inline((short) 0))).as(r.RDB$NULL_FLAG),
|
||||
r.RDB$DEFAULT_SOURCE,
|
||||
f.RDB$COMPUTED_SOURCE,
|
||||
r.RDB$FIELD_POSITION,
|
||||
|
||||
@ -37,6 +37,10 @@
|
||||
*/
|
||||
package org.jooq.meta.firebird;
|
||||
|
||||
import static org.jooq.impl.DSL.bitOr;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.trim;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.CHARACTER_LENGTH;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.FIELD_SCALE;
|
||||
import static org.jooq.meta.firebird.FirebirdDatabase.FIELD_TYPE;
|
||||
@ -49,7 +53,6 @@ import java.util.List;
|
||||
|
||||
import org.jooq.Record;
|
||||
import org.jooq.TableOptions.TableType;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractTableDefinition;
|
||||
import org.jooq.meta.ColumnDefinition;
|
||||
import org.jooq.meta.DefaultColumnDefinition;
|
||||
@ -88,10 +91,10 @@ public class FirebirdTableValuedFunction extends AbstractTableDefinition {
|
||||
for (Record record : create()
|
||||
.select(
|
||||
p.RDB$PARAMETER_NUMBER,
|
||||
p.RDB$PARAMETER_NAME.trim(),
|
||||
trim(p.RDB$PARAMETER_NAME).as(p.RDB$PARAMETER_NAME),
|
||||
p.RDB$DESCRIPTION,
|
||||
p.RDB$DEFAULT_VALUE,
|
||||
DSL.bitOr(p.RDB$NULL_FLAG.nvl((short) 0), f.RDB$NULL_FLAG.nvl((short) 0)).as(p.RDB$NULL_FLAG),
|
||||
bitOr(nvl(p.RDB$NULL_FLAG, inline((short) 0)), nvl(f.RDB$NULL_FLAG, inline((short) 0))).as(p.RDB$NULL_FLAG),
|
||||
p.RDB$DEFAULT_SOURCE,
|
||||
|
||||
// [#3342] FIELD_LENGTH should be ignored for LOBs
|
||||
@ -119,7 +122,7 @@ public class FirebirdTableValuedFunction extends AbstractTableDefinition {
|
||||
|
||||
result.add(new DefaultColumnDefinition(
|
||||
getDatabase().getTable(getSchema(), getName()),
|
||||
record.get(p.RDB$PARAMETER_NAME.trim()),
|
||||
record.get(p.RDB$PARAMETER_NAME),
|
||||
result.size() + 1,
|
||||
type,
|
||||
false,
|
||||
|
||||
@ -53,6 +53,7 @@ import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.not;
|
||||
import static org.jooq.impl.DSL.nullif;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.one;
|
||||
import static org.jooq.impl.DSL.row;
|
||||
import static org.jooq.impl.DSL.select;
|
||||
@ -590,7 +591,7 @@ public class H2Database extends AbstractDatabase implements ResultQueryDatabase
|
||||
COLUMNS.CHECK_CONSTRAINT
|
||||
)
|
||||
.from(COLUMNS)
|
||||
.where(COLUMNS.CHECK_CONSTRAINT.nvl("").ne(""))
|
||||
.where(nvl(COLUMNS.CHECK_CONSTRAINT, inline("")).ne(inline("")))
|
||||
.and(COLUMNS.TABLE_SCHEMA.in(getInputSchemata()));
|
||||
|
||||
for (Record record : create()
|
||||
|
||||
@ -39,11 +39,9 @@ package org.jooq.meta.h2;
|
||||
|
||||
|
||||
import static org.jooq.impl.DSL.concat;
|
||||
import static org.jooq.impl.DSL.condition;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.val;
|
||||
import static org.jooq.meta.h2.information_schema.Tables.FUNCTION_COLUMNS;
|
||||
import static org.jooq.meta.hsqldb.information_schema.Tables.ELEMENT_TYPES;
|
||||
import static org.jooq.meta.hsqldb.information_schema.Tables.PARAMETERS;
|
||||
|
||||
@ -41,10 +41,10 @@ import static org.jooq.impl.DSL.any;
|
||||
import static org.jooq.impl.DSL.choose;
|
||||
import static org.jooq.impl.DSL.coalesce;
|
||||
import static org.jooq.impl.DSL.condition;
|
||||
import static org.jooq.impl.DSL.decode;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.impl.SQLDataType.BOOLEAN;
|
||||
import static org.jooq.meta.h2.information_schema.Tables.COLUMNS;
|
||||
@ -215,8 +215,8 @@ public class H2TableDefinition extends AbstractTableDefinition {
|
||||
).as(COLUMNS.TYPE_NAME),
|
||||
choose().when(COLUMNS.NUMERIC_PRECISION.eq(maxP).and(COLUMNS.NUMERIC_SCALE.eq(maxS)), inline(0L))
|
||||
.otherwise(COLUMNS.CHARACTER_MAXIMUM_LENGTH).as(COLUMNS.CHARACTER_MAXIMUM_LENGTH),
|
||||
COLUMNS.NUMERIC_PRECISION.decode(maxP, inline(0L), COLUMNS.NUMERIC_PRECISION).as(COLUMNS.NUMERIC_PRECISION),
|
||||
COLUMNS.NUMERIC_SCALE.decode(maxS, inline(0L), COLUMNS.NUMERIC_SCALE).as(COLUMNS.NUMERIC_SCALE),
|
||||
decode(COLUMNS.NUMERIC_PRECISION, maxP, inline(0L), COLUMNS.NUMERIC_PRECISION).as(COLUMNS.NUMERIC_PRECISION),
|
||||
decode(COLUMNS.NUMERIC_SCALE, maxS, inline(0L), COLUMNS.NUMERIC_SCALE).as(COLUMNS.NUMERIC_SCALE),
|
||||
COLUMNS.IS_NULLABLE,
|
||||
COLUMNS.IS_COMPUTED.as(COLUMNS.IS_COMPUTED),
|
||||
COLUMNS.COLUMN_DEFAULT.as("GENERATION_EXPRESSION"),
|
||||
|
||||
@ -44,10 +44,12 @@ import static org.jooq.impl.DSL.decode;
|
||||
import static org.jooq.impl.DSL.falseCondition;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.lower;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.nvl;
|
||||
import static org.jooq.impl.DSL.select;
|
||||
import static org.jooq.impl.DSL.trim;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.impl.SQLDataType.BIGINT;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
@ -516,9 +518,9 @@ public class HSQLDBDatabase extends AbstractDatabase implements ResultQueryDatab
|
||||
SYSTEM_TABLES.TABLE_NAME,
|
||||
inline("").as(ROUTINES.SPECIFIC_NAME),
|
||||
SYSTEM_TABLES.REMARKS,
|
||||
when(SYSTEM_TABLES.TABLE_TYPE.eq(inline("VIEW")), inline(TableType.VIEW.name()))
|
||||
.else_(inline(TableType.TABLE.name())).trim().as("table_type"),
|
||||
when(VIEWS.VIEW_DEFINITION.lower().like(inline("create%")), VIEWS.VIEW_DEFINITION)
|
||||
trim(when(SYSTEM_TABLES.TABLE_TYPE.eq(inline("VIEW")), inline(TableType.VIEW.name()))
|
||||
.else_(inline(TableType.TABLE.name()))).as("table_type"),
|
||||
when(lower(VIEWS.VIEW_DEFINITION).like(inline("create%")), VIEWS.VIEW_DEFINITION)
|
||||
.else_(inline("create view \"").concat(SYSTEM_TABLES.TABLE_NAME).concat("\" as ").concat(VIEWS.VIEW_DEFINITION)).as(VIEWS.VIEW_DEFINITION)
|
||||
)
|
||||
.from(SYSTEM_TABLES)
|
||||
|
||||
@ -51,6 +51,7 @@ import static org.jooq.impl.DSL.cast;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.length;
|
||||
import static org.jooq.impl.DSL.lower;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.noCondition;
|
||||
import static org.jooq.impl.DSL.regexpReplaceAll;
|
||||
@ -453,7 +454,7 @@ public class MySQLDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
VIEWS.TABLE_CATALOG,
|
||||
VIEWS.TABLE_SCHEMA,
|
||||
VIEWS.TABLE_NAME,
|
||||
when(VIEWS.VIEW_DEFINITION.lower().like(inline("create%")), VIEWS.VIEW_DEFINITION)
|
||||
when(lower(VIEWS.VIEW_DEFINITION).like(inline("create%")), VIEWS.VIEW_DEFINITION)
|
||||
.else_(inline("create view `").concat(VIEWS.TABLE_NAME).concat(inline("` as ")).concat(VIEWS.VIEW_DEFINITION)).as(VIEWS.VIEW_DEFINITION))
|
||||
.from(VIEWS)
|
||||
.where(VIEWS.TABLE_SCHEMA.in(schemas))
|
||||
@ -795,12 +796,12 @@ public class MySQLDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
|
||||
@Override
|
||||
protected boolean exists0(TableField<?, ?> field) {
|
||||
return exists1(field, COLUMNS.COLUMNS, COLUMNS.TABLE_SCHEMA, COLUMNS.TABLE_NAME, COLUMNS.COLUMN_NAME);
|
||||
return exists1(field, COLUMNS, COLUMNS.TABLE_SCHEMA, COLUMNS.TABLE_NAME, COLUMNS.COLUMN_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean exists0(Table<?> table) {
|
||||
return exists1(table, TABLES.TABLES, TABLES.TABLE_SCHEMA, TABLES.TABLE_NAME);
|
||||
return exists1(table, TABLES, TABLES.TABLE_SCHEMA, TABLES.TABLE_NAME);
|
||||
}
|
||||
|
||||
private List<Field<String>> workaroundFor5213(List<String> inputSchemata) {
|
||||
|
||||
@ -138,7 +138,6 @@ import org.jooq.Result;
|
||||
import org.jooq.ResultQuery;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Select;
|
||||
import org.jooq.SelectOrderByStep;
|
||||
import org.jooq.SortOrder;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
@ -190,8 +189,6 @@ import org.jooq.meta.postgres.pg_catalog.tables.PgInherits;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgType;
|
||||
import org.jooq.tools.JooqLogger;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Postgres uses the ANSI default INFORMATION_SCHEMA, but unfortunately ships
|
||||
* with a non-capitalised version of it: <code>information_schema</code>. Hence
|
||||
|
||||
@ -56,7 +56,6 @@ import static org.jooq.meta.postgres.pg_catalog.Tables.PG_DESCRIPTION;
|
||||
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_NAMESPACE;
|
||||
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_TYPE;
|
||||
import static org.jooq.tools.StringUtils.defaultString;
|
||||
import static org.jooq.util.postgres.PostgresDSL.oid;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@ -80,8 +79,6 @@ import org.jooq.meta.postgres.pg_catalog.tables.PgCollation;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgNamespace;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgType;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
|
||||
@ -45,7 +45,6 @@ import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.partitionBy;
|
||||
import static org.jooq.impl.DSL.substring;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.meta.postgres.information_schema.Tables.COLUMNS;
|
||||
import static org.jooq.meta.postgres.information_schema.Tables.PARAMETERS;
|
||||
import static org.jooq.meta.postgres.information_schema.Tables.ROUTINES;
|
||||
|
||||
|
||||
@ -73,7 +73,6 @@ import org.jooq.meta.DefaultColumnDefinition;
|
||||
import org.jooq.meta.DefaultDataTypeDefinition;
|
||||
import org.jooq.meta.ParameterDefinition;
|
||||
import org.jooq.meta.SchemaDefinition;
|
||||
import org.jooq.meta.TableDefinition;
|
||||
import org.jooq.meta.postgres.information_schema.tables.Columns;
|
||||
import org.jooq.meta.postgres.information_schema.tables.Parameters;
|
||||
import org.jooq.meta.postgres.information_schema.tables.Routines;
|
||||
|
||||
@ -40,14 +40,10 @@ package org.jooq.meta.postgres;
|
||||
import static org.jooq.impl.DSL.coalesce;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.substring;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.meta.postgres.information_schema.Tables.ATTRIBUTES;
|
||||
import static org.jooq.meta.postgres.information_schema.Tables.COLUMNS;
|
||||
import static org.jooq.meta.postgres.information_schema.Tables.DOMAINS;
|
||||
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_ATTRIBUTE;
|
||||
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_CLASS;
|
||||
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_NAMESPACE;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@ -58,17 +54,13 @@ import org.jooq.Record;
|
||||
import org.jooq.meta.AbstractUDTDefinition;
|
||||
import org.jooq.meta.AttributeDefinition;
|
||||
import org.jooq.meta.DataTypeDefinition;
|
||||
import org.jooq.meta.Database;
|
||||
import org.jooq.meta.DefaultAttributeDefinition;
|
||||
import org.jooq.meta.DefaultDataTypeDefinition;
|
||||
import org.jooq.meta.RoutineDefinition;
|
||||
import org.jooq.meta.SchemaDefinition;
|
||||
import org.jooq.meta.postgres.information_schema.tables.Attributes;
|
||||
import org.jooq.meta.postgres.information_schema.tables.Domains;
|
||||
import org.jooq.meta.postgres.pg_catalog.Tables;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgAttribute;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgClass;
|
||||
import org.jooq.meta.postgres.pg_catalog.tables.PgNamespace;
|
||||
|
||||
public class PostgresUDTDefinition extends AbstractUDTDefinition {
|
||||
|
||||
|
||||
@ -40,6 +40,7 @@ package org.jooq.meta.sqlite;
|
||||
import static org.jooq.conf.ParseWithMetaLookups.THROW_ON_FAILURE;
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.lower;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.selectOne;
|
||||
import static org.jooq.impl.QOM.GenerationOption.STORED;
|
||||
@ -236,7 +237,7 @@ public class SQLiteTableDefinition extends AbstractTableDefinition {
|
||||
existsSqliteSequence = create()
|
||||
.selectCount()
|
||||
.from(SQLITE_MASTER)
|
||||
.where(SQLiteMaster.NAME.lower().eq("sqlite_sequence"))
|
||||
.where(lower(SQLiteMaster.NAME).eq("sqlite_sequence"))
|
||||
.fetchOne(0, boolean.class);
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,8 @@ package org.jooq.meta.trino;
|
||||
|
||||
import static org.jooq.Records.mapping;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.lower;
|
||||
import static org.jooq.impl.DSL.trim;
|
||||
import static org.jooq.impl.DSL.when;
|
||||
import static org.jooq.meta.hsqldb.information_schema.Tables.SCHEMATA;
|
||||
import static org.jooq.meta.hsqldb.information_schema.Tables.TABLES;
|
||||
@ -96,8 +98,8 @@ public class TrinoDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
.select(
|
||||
TABLES.TABLE_SCHEMA,
|
||||
TABLES.TABLE_NAME,
|
||||
when(TABLES.TABLE_TYPE.eq(inline("VIEW")), inline(TableType.VIEW.name()))
|
||||
.else_(inline(TableType.TABLE.name())).trim().as("table_type")
|
||||
trim(when(TABLES.TABLE_TYPE.eq(inline("VIEW")), inline(TableType.VIEW.name()))
|
||||
.else_(inline(TableType.TABLE.name()))).as("table_type")
|
||||
)
|
||||
.from(TABLES)
|
||||
.where(TABLES.TABLE_SCHEMA.in(getInputSchemata()))
|
||||
@ -159,7 +161,7 @@ public class TrinoDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
inline("").as(VIEWS.TABLE_CATALOG),
|
||||
VIEWS.TABLE_SCHEMA,
|
||||
VIEWS.TABLE_NAME,
|
||||
when(VIEWS.VIEW_DEFINITION.lower().like(inline("create%")), VIEWS.VIEW_DEFINITION)
|
||||
when(lower(VIEWS.VIEW_DEFINITION).like(inline("create%")), VIEWS.VIEW_DEFINITION)
|
||||
.else_(inline("create view \"").concat(VIEWS.TABLE_NAME).concat(inline("\" as ")).concat(VIEWS.VIEW_DEFINITION)).as(VIEWS.VIEW_DEFINITION)
|
||||
)
|
||||
.from(VIEWS)
|
||||
|
||||
@ -40,7 +40,6 @@ package org.jooq.meta.xml;
|
||||
|
||||
import static java.lang.Boolean.FALSE;
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.emptySet;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.tools.StringUtils.defaultIfBlank;
|
||||
import static org.jooq.tools.StringUtils.defaultIfNull;
|
||||
@ -57,7 +56,6 @@ import java.io.StringWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -84,10 +82,10 @@ import org.jooq.FilePattern.Sort;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.SortOrder;
|
||||
// ...
|
||||
import org.jooq.TableOptions.TableType;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.exception.IOException;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.AbstractDatabase;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user