From 7308b1f2b7dfc0fc0e24e2aef6815e3cb6bb541e Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Thu, 12 Sep 2024 15:21:48 +0200 Subject: [PATCH] [jOOQ/jOOQ#12494] Rename Record.changed() to Record.touched() --- .../org/jooq/meta/duckdb/DuckDBDatabase.java | 46 ++- .../meta/duckdb/DuckDBTableDefinition.java | 2 +- .../information_schema/InformationSchema.java | 3 +- .../information_schema/tables/Columns.java | 368 +++++------------- .../tables/KeyColumnUsage.java | 2 +- .../tables/ReferentialConstraints.java | 28 +- .../information_schema/tables/Schemata.java | 59 ++- .../tables/TableConstraints.java | 26 +- .../information_schema/tables/Tables.java | 60 +-- .../jooq/meta/duckdb/system/main/Main.java | 3 +- .../system/main/tables/DuckdbConstraints.java | 16 + .../system/main/tables/DuckdbDatabases.java | 17 + .../system/main/tables/DuckdbIndexes.java | 12 + .../system/main/tables/DuckdbSchemas.java | 12 + .../system/main/tables/DuckdbTables.java | 12 + .../system/main/tables/DuckdbTypes.java | 12 + .../system/main/tables/DuckdbViews.java | 12 + jOOQ/src/main/java/org/jooq/DSLContext.java | 16 +- jOOQ/src/main/java/org/jooq/Field.java | 18 + .../src/main/java/org/jooq/InsertSetStep.java | 4 +- .../main/java/org/jooq/InsertValuesStep1.java | 4 +- .../java/org/jooq/InsertValuesStep10.java | 4 +- .../java/org/jooq/InsertValuesStep11.java | 4 +- .../java/org/jooq/InsertValuesStep12.java | 4 +- .../java/org/jooq/InsertValuesStep13.java | 4 +- .../java/org/jooq/InsertValuesStep14.java | 4 +- .../java/org/jooq/InsertValuesStep15.java | 4 +- .../java/org/jooq/InsertValuesStep16.java | 4 +- .../java/org/jooq/InsertValuesStep17.java | 4 +- .../java/org/jooq/InsertValuesStep18.java | 4 +- .../java/org/jooq/InsertValuesStep19.java | 4 +- .../main/java/org/jooq/InsertValuesStep2.java | 4 +- .../java/org/jooq/InsertValuesStep20.java | 4 +- .../java/org/jooq/InsertValuesStep21.java | 4 +- .../java/org/jooq/InsertValuesStep22.java | 4 +- .../main/java/org/jooq/InsertValuesStep3.java | 4 +- .../main/java/org/jooq/InsertValuesStep4.java | 4 +- .../main/java/org/jooq/InsertValuesStep5.java | 4 +- .../main/java/org/jooq/InsertValuesStep6.java | 4 +- .../main/java/org/jooq/InsertValuesStep7.java | 4 +- .../main/java/org/jooq/InsertValuesStep8.java | 4 +- .../main/java/org/jooq/InsertValuesStep9.java | 4 +- .../main/java/org/jooq/InsertValuesStepN.java | 4 +- .../java/org/jooq/MergeMatchedSetStep.java | 4 +- jOOQ/src/main/java/org/jooq/Record.java | 155 +++++++- jOOQ/src/main/java/org/jooq/TableRecord.java | 6 +- .../main/java/org/jooq/UpdatableRecord.java | 34 +- .../src/main/java/org/jooq/UpdateSetStep.java | 4 +- .../java/org/jooq/impl/AbstractField.java | 5 + .../java/org/jooq/impl/AbstractRecord.java | 142 +++++-- .../java/org/jooq/impl/AbstractResult.java | 10 +- .../org/jooq/impl/AbstractStoreQuery.java | 2 +- .../main/java/org/jooq/impl/BatchCRUD.java | 2 +- jOOQ/src/main/java/org/jooq/impl/DAOImpl.java | 4 +- .../java/org/jooq/impl/DefaultBinding.java | 6 +- .../java/org/jooq/impl/HistoryRecord.java | 2 +- .../main/java/org/jooq/impl/InsertImpl.java | 2 +- .../java/org/jooq/impl/InsertQueryImpl.java | 2 +- .../main/java/org/jooq/impl/JSONReader.java | 6 +- .../main/java/org/jooq/impl/ListHandler.java | 2 +- .../main/java/org/jooq/impl/MergeImpl.java | 2 +- .../java/org/jooq/impl/MigrationImpl.java | 2 +- .../java/org/jooq/impl/TableRecordImpl.java | 14 +- jOOQ/src/main/java/org/jooq/impl/Tools.java | 12 +- .../org/jooq/impl/UpdatableRecordImpl.java | 18 +- .../main/java/org/jooq/impl/UpdateImpl.java | 2 +- .../main/java/org/jooq/impl/XMLHandler.java | 2 +- .../java/org/jooq/tools/LoggerListener.java | 2 +- pom.xml | 2 +- 69 files changed, 695 insertions(+), 569 deletions(-) diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBDatabase.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBDatabase.java index f245e966bf..fe41b4f938 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBDatabase.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBDatabase.java @@ -115,15 +115,25 @@ import org.jetbrains.annotations.NotNull; */ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatabase { - private Boolean is0100; + private Boolean is_0_10_0; + private Boolean is_1_1_0; - boolean is0100() { + boolean is_0_10_0() { // [#16289] The COMMENTS fields were introduced with DuckDB 0.10.0 - if (is0100 == null) - is0100 = configuredDialectIsNotFamilyAndSupports(asList(DUCKDB), () -> exists(DUCKDB_TABLES.COMMENT)); + if (is_0_10_0 == null) + is_0_10_0 = configuredDialectIsNotFamilyAndSupports(asList(DUCKDB), () -> exists(DUCKDB_TABLES.COMMENT)); - return is0100; + return is_0_10_0; + } + + boolean is_1_1_0() { + + // [#16492] The CONSTRAINT_NAME field was introduced with DuckDB 1.1.0 + if (is_1_1_0 == null) + is_1_1_0 = configuredDialectIsNotFamilyAndSupports(asList(DUCKDB), () -> exists(DUCKDB_CONSTRAINTS.CONSTRAINT_NAME)); + + return is_1_1_0; } @Override @@ -152,7 +162,7 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab if (catalog != null) { SchemaDefinition schema = catalog.getSchema(record.get(DUCKDB_CONSTRAINTS.SCHEMA_NAME)); - String key = record.get(DUCKDB_CONSTRAINTS.CONSTRAINT_TEXT); + String key = record.get(DUCKDB_CONSTRAINTS.CONSTRAINT_NAME); String tableName = record.get(DUCKDB_CONSTRAINTS.TABLE_NAME); String columnName = record.get(DUCKDB_CONSTRAINTS.CONSTRAINT_COLUMN_NAMES, String.class); @@ -170,7 +180,7 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab if (catalog != null) { SchemaDefinition schema = catalog.getSchema(record.get(DUCKDB_CONSTRAINTS.SCHEMA_NAME)); - String key = record.get(DUCKDB_CONSTRAINTS.CONSTRAINT_TEXT); + String key = record.get(DUCKDB_CONSTRAINTS.CONSTRAINT_NAME); String tableName = record.get(DUCKDB_CONSTRAINTS.TABLE_NAME); String columnName = record.get(DUCKDB_CONSTRAINTS.CONSTRAINT_COLUMN_NAMES, String.class); @@ -197,13 +207,15 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab DUCKDB_CONSTRAINTS.DATABASE_NAME, DUCKDB_CONSTRAINTS.SCHEMA_NAME, DUCKDB_CONSTRAINTS.TABLE_NAME, - DUCKDB_CONSTRAINTS.DATABASE_NAME - .concat(inline("__")) - .concat(DUCKDB_CONSTRAINTS.SCHEMA_NAME) - .concat(inline("__")) - .concat(DUCKDB_CONSTRAINTS.TABLE_NAME) - .concat(inline("__")) - .concat(DUCKDB_CONSTRAINTS.CONSTRAINT_TEXT).as(DUCKDB_CONSTRAINTS.CONSTRAINT_TEXT), + is_1_1_0() + ? DUCKDB_CONSTRAINTS.CONSTRAINT_NAME + : DUCKDB_CONSTRAINTS.DATABASE_NAME + .concat(inline("__")) + .concat(DUCKDB_CONSTRAINTS.SCHEMA_NAME) + .concat(inline("__")) + .concat(DUCKDB_CONSTRAINTS.TABLE_NAME) + .concat(inline("__")) + .concat(DUCKDB_CONSTRAINTS.CONSTRAINT_TEXT).as(DUCKDB_CONSTRAINTS.CONSTRAINT_NAME), field("unnest({0})", VARCHAR, DUCKDB_CONSTRAINTS.CONSTRAINT_COLUMN_NAMES).as(DUCKDB_CONSTRAINTS.CONSTRAINT_COLUMN_NAMES), field("unnest({0})", INTEGER, DUCKDB_CONSTRAINTS.CONSTRAINT_COLUMN_INDEXES).as(DUCKDB_CONSTRAINTS.CONSTRAINT_COLUMN_INDEXES) ) @@ -240,7 +252,7 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab .join(pkKcu) .on(pkKcu.CONSTRAINT_SCHEMA.eq(TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA)) .and(pkKcu.CONSTRAINT_NAME.eq(TABLE_CONSTRAINTS.CONSTRAINT_NAME)) - .and(pkKcu.ORDINAL_POSITION.eq(fkKcu.POSITION_IN_UNIQUE_CONSTRAINT)) + .and(pkKcu.ORDINAL_POSITION.eq(fkKcu.POSITION_IN_UNIQUE_CONSTRAINT.coerce(pkKcu.ORDINAL_POSITION))) .where(fkKcu.TABLE_SCHEMA.in(getInputSchemata())) .orderBy( fkKcu.TABLE_SCHEMA.asc(), @@ -474,7 +486,7 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab DUCKDB_TABLES.SCHEMA_NAME, DUCKDB_TABLES.TABLE_NAME, inline(TableType.TABLE.name()).as("table_type"), - is0100() + is_0_10_0() ? DUCKDB_TABLES.COMMENT : inline(null, VARCHAR).as(DUCKDB_TABLES.COMMENT) ) @@ -488,7 +500,7 @@ public class DuckDBDatabase extends AbstractDatabase implements ResultQueryDatab DUCKDB_VIEWS.SCHEMA_NAME, DUCKDB_VIEWS.VIEW_NAME, inline(TableType.VIEW.name()).as("table_type"), - is0100() + is_0_10_0() ? DUCKDB_VIEWS.COMMENT : inline(null, VARCHAR).as(DUCKDB_VIEWS.COMMENT) ) diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBTableDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBTableDefinition.java index 578d8ab7cc..f3ab97e756 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBTableDefinition.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/DuckDBTableDefinition.java @@ -92,7 +92,7 @@ public class DuckDBTableDefinition extends AbstractTableDefinition { when( DUCKDB_TYPES.LOGICAL_TYPE.eq(inline("STRUCT")), DUCKDB_TYPES.TYPE_NAME).as(DUCKDB_TYPES.TYPE_NAME), - ((DuckDBDatabase) getDatabase()).is0100() + ((DuckDBDatabase) getDatabase()).is_0_10_0() ? DUCKDB_COLUMNS.COMMENT : inline(null, VARCHAR).as(DUCKDB_COLUMNS.COMMENT) ) diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/InformationSchema.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/InformationSchema.java index 660d628410..109998f31e 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/InformationSchema.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/InformationSchema.java @@ -9,6 +9,7 @@ import java.util.List; import org.jooq.Catalog; import org.jooq.Table; +import org.jooq.impl.DSL; import org.jooq.impl.SchemaImpl; import org.jooq.meta.duckdb.system.System; import org.jooq.meta.duckdb.system.information_schema.tables.Columns; @@ -66,7 +67,7 @@ public class InformationSchema extends SchemaImpl { * No further instances allowed */ private InformationSchema() { - super("information_schema", null); + super(DSL.name("information_schema"), null, DSL.comment("")); } diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Columns.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Columns.java index 3712f3486f..d74cf00e5b 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Columns.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Columns.java @@ -93,15 +93,10 @@ public class Columns extends TableImpl { public final TableField CHARACTER_MAXIMUM_LENGTH = createField(DSL.name("character_maximum_length"), SQLDataType.INTEGER, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.character_octet_length. */ - @Deprecated - public final TableField CHARACTER_OCTET_LENGTH = createField(DSL.name("character_octet_length"), SQLDataType.OTHER, this, ""); + public final TableField CHARACTER_OCTET_LENGTH = createField(DSL.name("character_octet_length"), SQLDataType.INTEGER, this, ""); /** * The column @@ -121,345 +116,178 @@ public class Columns extends TableImpl { public final TableField NUMERIC_SCALE = createField(DSL.name("numeric_scale"), SQLDataType.INTEGER, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.datetime_precision. */ - @Deprecated - public final TableField DATETIME_PRECISION = createField(DSL.name("datetime_precision"), SQLDataType.OTHER, this, ""); + public final TableField DATETIME_PRECISION = createField(DSL.name("datetime_precision"), SQLDataType.INTEGER, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.interval_type. */ - @Deprecated - public final TableField INTERVAL_TYPE = createField(DSL.name("interval_type"), SQLDataType.OTHER, this, ""); + public final TableField INTERVAL_TYPE = createField(DSL.name("interval_type"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.interval_precision. */ - @Deprecated - public final TableField INTERVAL_PRECISION = createField(DSL.name("interval_precision"), SQLDataType.OTHER, this, ""); + public final TableField INTERVAL_PRECISION = createField(DSL.name("interval_precision"), SQLDataType.INTEGER, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.character_set_catalog. */ - @Deprecated - public final TableField CHARACTER_SET_CATALOG = createField(DSL.name("character_set_catalog"), SQLDataType.OTHER, this, ""); + public final TableField CHARACTER_SET_CATALOG = createField(DSL.name("character_set_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.character_set_schema. */ - @Deprecated - public final TableField CHARACTER_SET_SCHEMA = createField(DSL.name("character_set_schema"), SQLDataType.OTHER, this, ""); + public final TableField CHARACTER_SET_SCHEMA = createField(DSL.name("character_set_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.character_set_name. */ - @Deprecated - public final TableField CHARACTER_SET_NAME = createField(DSL.name("character_set_name"), SQLDataType.OTHER, this, ""); + public final TableField CHARACTER_SET_NAME = createField(DSL.name("character_set_name"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.collation_catalog. */ - @Deprecated - public final TableField COLLATION_CATALOG = createField(DSL.name("collation_catalog"), SQLDataType.OTHER, this, ""); + public final TableField COLLATION_CATALOG = createField(DSL.name("collation_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.collation_schema. */ - @Deprecated - public final TableField COLLATION_SCHEMA = createField(DSL.name("collation_schema"), SQLDataType.OTHER, this, ""); + public final TableField COLLATION_SCHEMA = createField(DSL.name("collation_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.collation_name. */ - @Deprecated - public final TableField COLLATION_NAME = createField(DSL.name("collation_name"), SQLDataType.OTHER, this, ""); + public final TableField COLLATION_NAME = createField(DSL.name("collation_name"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.domain_catalog. */ - @Deprecated - public final TableField DOMAIN_CATALOG = createField(DSL.name("domain_catalog"), SQLDataType.OTHER, this, ""); + public final TableField DOMAIN_CATALOG = createField(DSL.name("domain_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.domain_schema. */ - @Deprecated - public final TableField DOMAIN_SCHEMA = createField(DSL.name("domain_schema"), SQLDataType.OTHER, this, ""); + public final TableField DOMAIN_SCHEMA = createField(DSL.name("domain_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.domain_name. */ - @Deprecated - public final TableField DOMAIN_NAME = createField(DSL.name("domain_name"), SQLDataType.OTHER, this, ""); + public final TableField DOMAIN_NAME = createField(DSL.name("domain_name"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.udt_catalog. */ - @Deprecated - public final TableField UDT_CATALOG = createField(DSL.name("udt_catalog"), SQLDataType.OTHER, this, ""); + public final TableField UDT_CATALOG = createField(DSL.name("udt_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.udt_schema. */ - @Deprecated - public final TableField UDT_SCHEMA = createField(DSL.name("udt_schema"), SQLDataType.OTHER, this, ""); + public final TableField UDT_SCHEMA = createField(DSL.name("udt_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.udt_name. */ - @Deprecated - public final TableField UDT_NAME = createField(DSL.name("udt_name"), SQLDataType.OTHER, this, ""); + public final TableField UDT_NAME = createField(DSL.name("udt_name"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.scope_catalog. */ - @Deprecated - public final TableField SCOPE_CATALOG = createField(DSL.name("scope_catalog"), SQLDataType.OTHER, this, ""); + public final TableField SCOPE_CATALOG = createField(DSL.name("scope_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.scope_schema. */ - @Deprecated - public final TableField SCOPE_SCHEMA = createField(DSL.name("scope_schema"), SQLDataType.OTHER, this, ""); + public final TableField SCOPE_SCHEMA = createField(DSL.name("scope_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.scope_name. */ - @Deprecated - public final TableField SCOPE_NAME = createField(DSL.name("scope_name"), SQLDataType.OTHER, this, ""); + public final TableField SCOPE_NAME = createField(DSL.name("scope_name"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.maximum_cardinality. */ - @Deprecated - public final TableField MAXIMUM_CARDINALITY = createField(DSL.name("maximum_cardinality"), SQLDataType.OTHER, this, ""); + public final TableField MAXIMUM_CARDINALITY = createField(DSL.name("maximum_cardinality"), SQLDataType.BIGINT, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.dtd_identifier. */ - @Deprecated - public final TableField DTD_IDENTIFIER = createField(DSL.name("dtd_identifier"), SQLDataType.OTHER, this, ""); + public final TableField DTD_IDENTIFIER = createField(DSL.name("dtd_identifier"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.is_self_referencing. */ - @Deprecated - public final TableField IS_SELF_REFERENCING = createField(DSL.name("is_self_referencing"), SQLDataType.OTHER, this, ""); + public final TableField IS_SELF_REFERENCING = createField(DSL.name("is_self_referencing"), SQLDataType.BOOLEAN, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.is_identity. */ - @Deprecated - public final TableField IS_IDENTITY = createField(DSL.name("is_identity"), SQLDataType.OTHER, this, ""); + public final TableField IS_IDENTITY = createField(DSL.name("is_identity"), SQLDataType.BOOLEAN, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.identity_generation. */ - @Deprecated - public final TableField IDENTITY_GENERATION = createField(DSL.name("identity_generation"), SQLDataType.OTHER, this, ""); + public final TableField IDENTITY_GENERATION = createField(DSL.name("identity_generation"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.identity_start. */ - @Deprecated - public final TableField IDENTITY_START = createField(DSL.name("identity_start"), SQLDataType.OTHER, this, ""); + public final TableField IDENTITY_START = createField(DSL.name("identity_start"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.identity_increment. */ - @Deprecated - public final TableField IDENTITY_INCREMENT = createField(DSL.name("identity_increment"), SQLDataType.OTHER, this, ""); + public final TableField IDENTITY_INCREMENT = createField(DSL.name("identity_increment"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.identity_maximum. */ - @Deprecated - public final TableField IDENTITY_MAXIMUM = createField(DSL.name("identity_maximum"), SQLDataType.OTHER, this, ""); + public final TableField IDENTITY_MAXIMUM = createField(DSL.name("identity_maximum"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.identity_minimum. */ - @Deprecated - public final TableField IDENTITY_MINIMUM = createField(DSL.name("identity_minimum"), SQLDataType.OTHER, this, ""); + public final TableField IDENTITY_MINIMUM = createField(DSL.name("identity_minimum"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.identity_cycle. */ - @Deprecated - public final TableField IDENTITY_CYCLE = createField(DSL.name("identity_cycle"), SQLDataType.OTHER, this, ""); + public final TableField IDENTITY_CYCLE = createField(DSL.name("identity_cycle"), SQLDataType.BOOLEAN, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.is_generated. */ - @Deprecated - public final TableField IS_GENERATED = createField(DSL.name("is_generated"), SQLDataType.OTHER, this, ""); + public final TableField IS_GENERATED = createField(DSL.name("is_generated"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.columns.generation_expression. */ - @Deprecated - public final TableField GENERATION_EXPRESSION = createField(DSL.name("generation_expression"), SQLDataType.OTHER, this, ""); + public final TableField GENERATION_EXPRESSION = createField(DSL.name("generation_expression"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column system.information_schema.columns.is_updatable. */ - @Deprecated - public final TableField IS_UPDATABLE = createField(DSL.name("is_updatable"), SQLDataType.OTHER, this, ""); + public final TableField IS_UPDATABLE = createField(DSL.name("is_updatable"), SQLDataType.BOOLEAN, this, ""); + + /** + * The column system.information_schema.columns.COLUMN_COMMENT. + */ + public final TableField COLUMN_COMMENT = createField(DSL.name("COLUMN_COMMENT"), SQLDataType.VARCHAR, this, ""); private Columns(Name alias, Table aliased) { this(alias, aliased, (Field[]) null, null); @@ -503,20 +331,7 @@ public class Columns extends TableImpl { @Override public List> getReferences() { - return Arrays.asList(Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_TABLES, Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_SCHEMATA); - } - - private transient Tables _tables; - - /** - * Get the implicit join path to the - * system.information_schema.tables table. - */ - public Tables tables() { - if (_tables == null) - _tables = new Tables(this, Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_TABLES, null); - - return _tables; + return Arrays.asList(Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_SCHEMATA, Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_TABLES); } private transient Schemata _schemata; @@ -532,6 +347,19 @@ public class Columns extends TableImpl { return _schemata; } + private transient Tables _tables; + + /** + * Get the implicit join path to the + * system.information_schema.tables table. + */ + public Tables tables() { + if (_tables == null) + _tables = new Tables(this, Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_TABLES, null); + + return _tables; + } + @Override public Columns as(String alias) { return new Columns(DSL.name(alias), this); diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/KeyColumnUsage.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/KeyColumnUsage.java index 20f2d069d1..928ee0fa6b 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/KeyColumnUsage.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/KeyColumnUsage.java @@ -92,7 +92,7 @@ public class KeyColumnUsage extends TableImpl { * The column * system.information_schema.key_column_usage.ordinal_position. */ - public final TableField ORDINAL_POSITION = createField(DSL.name("ordinal_position"), SQLDataType.INTEGER, this, ""); + public final TableField ORDINAL_POSITION = createField(DSL.name("ordinal_position"), SQLDataType.BIGINT, this, ""); /** * The column diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/ReferentialConstraints.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/ReferentialConstraints.java index 8783331b2e..c3c03324a8 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/ReferentialConstraints.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/ReferentialConstraints.java @@ -145,20 +145,21 @@ public class ReferentialConstraints extends TableImpl { @Override public List> getReferences() { - return Arrays.asList(Keys.SYNTHETIC_FK_REFERENTIAL_CONSTRAINTS__SYNTHETIC_PK_SCHEMATA, Keys.REFERENCING_CONSTRAINT, Keys.REFERENCED_CONSTRAINT); + return Arrays.asList(Keys.REFERENCED_CONSTRAINT, Keys.REFERENCING_CONSTRAINT, Keys.SYNTHETIC_FK_REFERENTIAL_CONSTRAINTS__SYNTHETIC_PK_SCHEMATA); } - private transient Schemata _schemata; + private transient TableConstraints _referencedConstraint; /** * Get the implicit join path to the - * system.information_schema.schemata table. + * system.information_schema.table_constraints table, via the + * REFERENCED_CONSTRAINT key. */ - public Schemata schemata() { - if (_schemata == null) - _schemata = new Schemata(this, Keys.SYNTHETIC_FK_REFERENTIAL_CONSTRAINTS__SYNTHETIC_PK_SCHEMATA, null); + public TableConstraints referencedConstraint() { + if (_referencedConstraint == null) + _referencedConstraint = new TableConstraints(this, Keys.REFERENCED_CONSTRAINT, null); - return _schemata; + return _referencedConstraint; } private transient TableConstraints _referencingConstraint; @@ -175,18 +176,17 @@ public class ReferentialConstraints extends TableImpl { return _referencingConstraint; } - private transient TableConstraints _referencedConstraint; + private transient Schemata _schemata; /** * Get the implicit join path to the - * system.information_schema.table_constraints table, via the - * REFERENCED_CONSTRAINT key. + * system.information_schema.schemata table. */ - public TableConstraints referencedConstraint() { - if (_referencedConstraint == null) - _referencedConstraint = new TableConstraints(this, Keys.REFERENCED_CONSTRAINT, null); + public Schemata schemata() { + if (_schemata == null) + _schemata = new Schemata(this, Keys.SYNTHETIC_FK_REFERENTIAL_CONSTRAINTS__SYNTHETIC_PK_SCHEMATA, null); - return _referencedConstraint; + return _schemata; } @Override diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Schemata.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Schemata.java index efbbd4faa4..834fe34f29 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Schemata.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Schemata.java @@ -59,37 +59,22 @@ public class Schemata extends TableImpl { public final TableField SCHEMA_OWNER = createField(DSL.name("schema_owner"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.schemata.default_character_set_catalog. */ - @Deprecated - public final TableField DEFAULT_CHARACTER_SET_CATALOG = createField(DSL.name("default_character_set_catalog"), SQLDataType.OTHER, this, ""); + public final TableField DEFAULT_CHARACTER_SET_CATALOG = createField(DSL.name("default_character_set_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.schemata.default_character_set_schema. */ - @Deprecated - public final TableField DEFAULT_CHARACTER_SET_SCHEMA = createField(DSL.name("default_character_set_schema"), SQLDataType.OTHER, this, ""); + public final TableField DEFAULT_CHARACTER_SET_SCHEMA = createField(DSL.name("default_character_set_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.schemata.default_character_set_name. */ - @Deprecated - public final TableField DEFAULT_CHARACTER_SET_NAME = createField(DSL.name("default_character_set_name"), SQLDataType.OTHER, this, ""); + public final TableField DEFAULT_CHARACTER_SET_NAME = createField(DSL.name("default_character_set_name"), SQLDataType.VARCHAR, this, ""); /** * The column system.information_schema.schemata.sql_path. @@ -141,6 +126,19 @@ public class Schemata extends TableImpl { return Keys.SYNTHETIC_PK_SCHEMATA; } + private transient Columns _columns; + + /** + * Get the implicit to-many join path to the + * system.information_schema.columns table + */ + public Columns columns() { + if (_columns == null) + _columns = new Columns(this, null, Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_SCHEMATA.getInverseKey()); + + return _columns; + } + private transient KeyColumnUsage _keyColumnUsage; /** @@ -180,19 +178,6 @@ public class Schemata extends TableImpl { return _tableConstraints; } - private transient Columns _columns; - - /** - * Get the implicit to-many join path to the - * system.information_schema.columns table - */ - public Columns columns() { - if (_columns == null) - _columns = new Columns(this, null, Keys.SYNTHETIC_FK_COLUMNS__SYNTHETIC_PK_SCHEMATA.getInverseKey()); - - return _columns; - } - private transient Tables _tables; /** diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/TableConstraints.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/TableConstraints.java index 2ffabf55b9..d573b9265e 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/TableConstraints.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/TableConstraints.java @@ -177,17 +177,18 @@ public class TableConstraints extends TableImpl { return _schemata; } - private transient KeyColumnUsage _keyColumnUsage; + private transient ReferentialConstraints _referencedConstraint; /** * Get the implicit to-many join path to the - * system.information_schema.key_column_usage table + * system.information_schema.referential_constraints table, via + * the REFERENCED_CONSTRAINT key */ - public KeyColumnUsage keyColumnUsage() { - if (_keyColumnUsage == null) - _keyColumnUsage = new KeyColumnUsage(this, null, Keys.SYNTHETIC_FK_KEY_COLUMN_USAGE__SYNTHETIC_PK_TABLE_CONSTRAINTS.getInverseKey()); + public ReferentialConstraints referencedConstraint() { + if (_referencedConstraint == null) + _referencedConstraint = new ReferentialConstraints(this, null, Keys.REFERENCED_CONSTRAINT.getInverseKey()); - return _keyColumnUsage; + return _referencedConstraint; } private transient ReferentialConstraints _referencingConstraint; @@ -204,18 +205,17 @@ public class TableConstraints extends TableImpl { return _referencingConstraint; } - private transient ReferentialConstraints _referencedConstraint; + private transient KeyColumnUsage _keyColumnUsage; /** * Get the implicit to-many join path to the - * system.information_schema.referential_constraints table, via - * the REFERENCED_CONSTRAINT key + * system.information_schema.key_column_usage table */ - public ReferentialConstraints referencedConstraint() { - if (_referencedConstraint == null) - _referencedConstraint = new ReferentialConstraints(this, null, Keys.REFERENCED_CONSTRAINT.getInverseKey()); + public KeyColumnUsage keyColumnUsage() { + if (_keyColumnUsage == null) + _keyColumnUsage = new KeyColumnUsage(this, null, Keys.SYNTHETIC_FK_KEY_COLUMN_USAGE__SYNTHETIC_PK_TABLE_CONSTRAINTS.getInverseKey()); - return _referencedConstraint; + return _keyColumnUsage; } @Override diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Tables.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Tables.java index c028da5a72..3f8f30c4d8 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Tables.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/information_schema/tables/Tables.java @@ -67,59 +67,34 @@ public class Tables extends TableImpl { public final TableField TABLE_TYPE = createField(DSL.name("table_type"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.tables.self_referencing_column_name. */ - @Deprecated - public final TableField SELF_REFERENCING_COLUMN_NAME = createField(DSL.name("self_referencing_column_name"), SQLDataType.OTHER, this, ""); + public final TableField SELF_REFERENCING_COLUMN_NAME = createField(DSL.name("self_referencing_column_name"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.tables.reference_generation. */ - @Deprecated - public final TableField REFERENCE_GENERATION = createField(DSL.name("reference_generation"), SQLDataType.OTHER, this, ""); + public final TableField REFERENCE_GENERATION = createField(DSL.name("reference_generation"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.tables.user_defined_type_catalog. */ - @Deprecated - public final TableField USER_DEFINED_TYPE_CATALOG = createField(DSL.name("user_defined_type_catalog"), SQLDataType.OTHER, this, ""); + public final TableField USER_DEFINED_TYPE_CATALOG = createField(DSL.name("user_defined_type_catalog"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.tables.user_defined_type_schema. */ - @Deprecated - public final TableField USER_DEFINED_TYPE_SCHEMA = createField(DSL.name("user_defined_type_schema"), SQLDataType.OTHER, this, ""); + public final TableField USER_DEFINED_TYPE_SCHEMA = createField(DSL.name("user_defined_type_schema"), SQLDataType.VARCHAR, this, ""); /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. + * The column + * system.information_schema.tables.user_defined_type_name. */ - @Deprecated - public final TableField USER_DEFINED_TYPE_NAME = createField(DSL.name("user_defined_type_name"), SQLDataType.OTHER, this, ""); + public final TableField USER_DEFINED_TYPE_NAME = createField(DSL.name("user_defined_type_name"), SQLDataType.VARCHAR, this, ""); /** * The column @@ -137,6 +112,11 @@ public class Tables extends TableImpl { */ public final TableField COMMIT_ACTION = createField(DSL.name("commit_action"), SQLDataType.VARCHAR, this, ""); + /** + * The column system.information_schema.tables.TABLE_COMMENT. + */ + public final TableField TABLE_COMMENT = createField(DSL.name("TABLE_COMMENT"), SQLDataType.VARCHAR, this, ""); + private Tables(Name alias, Table aliased) { this(alias, aliased, (Field[]) null, null); } diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/Main.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/Main.java index cb6705a104..dcbfe49d49 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/Main.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/Main.java @@ -9,6 +9,7 @@ import java.util.List; import org.jooq.Catalog; import org.jooq.Table; +import org.jooq.impl.DSL; import org.jooq.impl.SchemaImpl; import org.jooq.meta.duckdb.system.System; import org.jooq.meta.duckdb.system.main.tables.DuckdbColumns; @@ -78,7 +79,7 @@ public class Main extends SchemaImpl { * No further instances allowed */ private Main() { - super("main", null); + super(DSL.name("main"), null, DSL.comment("")); } diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbConstraints.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbConstraints.java index 252eecb58d..7bcd1e2955 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbConstraints.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbConstraints.java @@ -101,6 +101,22 @@ public class DuckdbConstraints extends TableImpl { */ public final TableField CONSTRAINT_COLUMN_NAMES = createField(DSL.name("constraint_column_names"), SQLDataType.VARCHAR.array(), this, ""); + /** + * The column system.main.duckdb_constraints.constraint_name. + */ + public final TableField CONSTRAINT_NAME = createField(DSL.name("constraint_name"), SQLDataType.VARCHAR, this, ""); + + /** + * The column system.main.duckdb_constraints.referenced_table. + */ + public final TableField REFERENCED_TABLE = createField(DSL.name("referenced_table"), SQLDataType.VARCHAR, this, ""); + + /** + * The column + * system.main.duckdb_constraints.referenced_column_names. + */ + public final TableField REFERENCED_COLUMN_NAMES = createField(DSL.name("referenced_column_names"), SQLDataType.VARCHAR.array(), this, ""); + private DuckdbConstraints(Name alias, Table aliased) { this(alias, aliased, (Field[]) null, null); } diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbDatabases.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbDatabases.java index 00ea3cd765..e530275887 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbDatabases.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbDatabases.java @@ -13,6 +13,7 @@ import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import org.jooq.meta.duckdb.system.main.Main; @@ -59,6 +60,17 @@ public class DuckdbDatabases extends TableImpl { */ public final TableField COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, ""); + /** + * @deprecated Unknown data type. If this is a qualified, user-defined type, + * it may have been excluded from code generation. If this is a built-in + * type, you can define an explicit {@link org.jooq.Binding} to specify how + * this type should be handled. Deprecation can be turned off using + * {@literal } in your code generator + * configuration. + */ + @Deprecated + public final TableField TAGS = createField(DSL.name("tags"), DefaultDataType.getDefaultDataType("MAP(VARCHAR, VARCHAR)"), this, ""); + /** * The column system.main.duckdb_databases.internal. */ @@ -69,6 +81,11 @@ public class DuckdbDatabases extends TableImpl { */ public final TableField TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR, this, ""); + /** + * The column system.main.duckdb_databases.readonly. + */ + public final TableField READONLY = createField(DSL.name("readonly"), SQLDataType.BOOLEAN, this, ""); + private DuckdbDatabases(Name alias, Table aliased) { this(alias, aliased, (Field[]) null, null); } diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbIndexes.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbIndexes.java index 187c1f599a..4c27995094 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbIndexes.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbIndexes.java @@ -13,6 +13,7 @@ import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import org.jooq.meta.duckdb.system.main.Main; @@ -84,6 +85,17 @@ public class DuckdbIndexes extends TableImpl { */ public final TableField COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, ""); + /** + * @deprecated Unknown data type. If this is a qualified, user-defined type, + * it may have been excluded from code generation. If this is a built-in + * type, you can define an explicit {@link org.jooq.Binding} to specify how + * this type should be handled. Deprecation can be turned off using + * {@literal } in your code generator + * configuration. + */ + @Deprecated + public final TableField TAGS = createField(DSL.name("tags"), DefaultDataType.getDefaultDataType("MAP(VARCHAR, VARCHAR)"), this, ""); + /** * The column system.main.duckdb_indexes.is_unique. */ diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbSchemas.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbSchemas.java index 8d8f768e05..453081d7a6 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbSchemas.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbSchemas.java @@ -13,6 +13,7 @@ import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import org.jooq.meta.duckdb.system.main.Main; @@ -64,6 +65,17 @@ public class DuckdbSchemas extends TableImpl { */ public final TableField COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, ""); + /** + * @deprecated Unknown data type. If this is a qualified, user-defined type, + * it may have been excluded from code generation. If this is a built-in + * type, you can define an explicit {@link org.jooq.Binding} to specify how + * this type should be handled. Deprecation can be turned off using + * {@literal } in your code generator + * configuration. + */ + @Deprecated + public final TableField TAGS = createField(DSL.name("tags"), DefaultDataType.getDefaultDataType("MAP(VARCHAR, VARCHAR)"), this, ""); + /** * The column system.main.duckdb_schemas.internal. */ diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTables.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTables.java index c7805c4fa6..d7c2391cde 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTables.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTables.java @@ -16,6 +16,7 @@ import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import org.jooq.meta.duckdb.system.main.Keys; @@ -78,6 +79,17 @@ public class DuckdbTables extends TableImpl { */ public final TableField COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, ""); + /** + * @deprecated Unknown data type. If this is a qualified, user-defined type, + * it may have been excluded from code generation. If this is a built-in + * type, you can define an explicit {@link org.jooq.Binding} to specify how + * this type should be handled. Deprecation can be turned off using + * {@literal } in your code generator + * configuration. + */ + @Deprecated + public final TableField TAGS = createField(DSL.name("tags"), DefaultDataType.getDefaultDataType("MAP(VARCHAR, VARCHAR)"), this, ""); + /** * The column system.main.duckdb_tables.internal. */ diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTypes.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTypes.java index f90f7fb5ff..32392006bc 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTypes.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbTypes.java @@ -16,6 +16,7 @@ import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import org.jooq.meta.duckdb.system.main.Keys; @@ -93,6 +94,17 @@ public class DuckdbTypes extends TableImpl { */ public final TableField COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, ""); + /** + * @deprecated Unknown data type. If this is a qualified, user-defined type, + * it may have been excluded from code generation. If this is a built-in + * type, you can define an explicit {@link org.jooq.Binding} to specify how + * this type should be handled. Deprecation can be turned off using + * {@literal } in your code generator + * configuration. + */ + @Deprecated + public final TableField TAGS = createField(DSL.name("tags"), DefaultDataType.getDefaultDataType("MAP(VARCHAR, VARCHAR)"), this, ""); + /** * The column system.main.duckdb_types.internal. */ diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbViews.java b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbViews.java index 71b6d938e5..daaa0e1ec8 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbViews.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/duckdb/system/main/tables/DuckdbViews.java @@ -13,6 +13,7 @@ import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import org.jooq.meta.duckdb.system.main.Main; @@ -74,6 +75,17 @@ public class DuckdbViews extends TableImpl { */ public final TableField COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR, this, ""); + /** + * @deprecated Unknown data type. If this is a qualified, user-defined type, + * it may have been excluded from code generation. If this is a built-in + * type, you can define an explicit {@link org.jooq.Binding} to specify how + * this type should be handled. Deprecation can be turned off using + * {@literal } in your code generator + * configuration. + */ + @Deprecated + public final TableField TAGS = createField(DSL.name("tags"), DefaultDataType.getDefaultDataType("MAP(VARCHAR, VARCHAR)"), this, ""); + /** * The column system.main.duckdb_views.internal. */ diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java index 1b1316d41a..01ded808c7 100644 --- a/jOOQ/src/main/java/org/jooq/DSLContext.java +++ b/jOOQ/src/main/java/org/jooq/DSLContext.java @@ -12615,11 +12615,11 @@ public interface DSLContext extends Scope { * implementation is governed by * {@link Configuration#recordUnmapperProvider()}. *

- * The resulting record will have its internal "changed" flags set to true - * for all values. This means that {@link UpdatableRecord#store()} will - * perform an INSERT statement. If you wish to store the record - * using an UPDATE statement, use - * {@link #executeUpdate(UpdatableRecord)} instead. + * The resulting record will have its internal {@link Record#touched()} + * flags set to true for all values. This means that + * {@link UpdatableRecord#store()} will perform an INSERT + * statement. If you wish to store the record using an UPDATE + * statement, use {@link #executeUpdate(UpdatableRecord)} instead. *

* The resulting record is attached to this {@link Configuration} by * default. Use {@link Settings#isAttachRecords()} to override this @@ -15384,9 +15384,9 @@ public interface DSLContext extends Scope { * *

* Unlike {@link UpdatableRecord#insert()}, this does not change any of the - * argument record's internal "changed" flags, such that a - * subsequent call to {@link UpdatableRecord#insert()} might lead to another - * INSERT statement being executed. + * argument record's internal {@link Record#touched()} flags, + * such that a subsequent call to {@link UpdatableRecord#insert()} might + * lead to another INSERT statement being executed. *

* Also any optimistic locking related {@link Settings} do not apply for * this method. diff --git a/jOOQ/src/main/java/org/jooq/Field.java b/jOOQ/src/main/java/org/jooq/Field.java index d058e9c0df..8520c8f004 100644 --- a/jOOQ/src/main/java/org/jooq/Field.java +++ b/jOOQ/src/main/java/org/jooq/Field.java @@ -4107,9 +4107,27 @@ extends * .map(MY_TABLE.ID::changed) * .forEach(System.out::println); * + * + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(Record)} instead. */ + @Deprecated(forRemoval = true) boolean changed(Record record); + /** + * The inverse operation of {@link Record#touched(Field)}. + *

+ * This method can be used in its method reference form conveniently on a + * generated table, for instance, when mapping records in a stream: + *


+     * DSL.using(configuration)
+     *    .fetch("select * from t")
+     *    .stream()
+     *    .map(MY_TABLE.ID::touched)
+     *    .forEach(System.out::println);
+     * 
+ */ + boolean touched(Record record); + /** * The inverse operation of {@link Record#reset(Field)}. *

diff --git a/jOOQ/src/main/java/org/jooq/InsertSetStep.java b/jOOQ/src/main/java/org/jooq/InsertSetStep.java index e8ad407271..4aa9a0589a 100644 --- a/jOOQ/src/main/java/org/jooq/InsertSetStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertSetStep.java @@ -340,8 +340,8 @@ public interface InsertSetStep { *

* This is the same as calling {@link #set(Map)} with the argument record * treated as a Map<Field<?>, Object>, except that the - * {@link Record#changed()} flags are taken into consideration in order to - * update only changed values. + * {@link Record#touched()} flags are taken into consideration in order to + * update only touched values. * * @see #set(Map) */ diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java index 91a7a0b146..0c63ebc5a2 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep1.java @@ -126,7 +126,7 @@ public interface InsertValuesStep1 extends InsertOnDuplica * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep1 extends InsertOnDuplica * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java index 6d0506f54d..294fb0e0fb 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep10.java @@ -126,7 +126,7 @@ public interface InsertValuesStep10 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep10 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java index a71389d75b..04380a77b9 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep11.java @@ -126,7 +126,7 @@ public interface InsertValuesStep11 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep11 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java index a63ec2c102..e74cf61a39 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep12.java @@ -126,7 +126,7 @@ public interface InsertValuesStep12 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep12 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java index 1c55f7a5e8..c7708f79a0 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep13.java @@ -126,7 +126,7 @@ public interface InsertValuesStep13 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep13 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java index adf00ca5f0..8f64c14b18 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep14.java @@ -126,7 +126,7 @@ public interface InsertValuesStep14 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep14 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java index 4f6e088955..24719e6221 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep15.java @@ -126,7 +126,7 @@ public interface InsertValuesStep15 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep15 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java index c0e8c5a4cb..f654d7fdf3 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep16.java @@ -126,7 +126,7 @@ public interface InsertValuesStep16 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep16 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java index 0e05ffb303..c2182e4cd4 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep17.java @@ -126,7 +126,7 @@ public interface InsertValuesStep17 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep17 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java index ca0f396e26..d23b85fc75 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep18.java @@ -126,7 +126,7 @@ public interface InsertValuesStep18 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep18 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java index 253925c95b..74dd98dafc 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep19.java @@ -126,7 +126,7 @@ public interface InsertValuesStep19 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep19 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java index 4b9b5a5e1f..8b7d0fe589 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep2.java @@ -126,7 +126,7 @@ public interface InsertValuesStep2 extends InsertOnDup * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep2 extends InsertOnDup * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java index 7112d07b5a..a2db3b1cd0 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep20.java @@ -126,7 +126,7 @@ public interface InsertValuesStep20 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep20 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java index 025572dd88..2d5946bdee 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep21.java @@ -126,7 +126,7 @@ public interface InsertValuesStep21 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep21 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java index 85011c3c6b..c6265f2f89 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep22.java @@ -126,7 +126,7 @@ public interface InsertValuesStep22 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep22 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java index 30f34425b3..05b3b93584 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep3.java @@ -126,7 +126,7 @@ public interface InsertValuesStep3 extends InsertO * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep3 extends InsertO * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java index 353bf9c9cf..770bf9416b 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep4.java @@ -126,7 +126,7 @@ public interface InsertValuesStep4 extends Ins * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep4 extends Ins * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java index 5ec3087397..15a6c0689b 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep5.java @@ -126,7 +126,7 @@ public interface InsertValuesStep5 extends * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep5 extends * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java index 6531bbba98..05289a7603 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep6.java @@ -126,7 +126,7 @@ public interface InsertValuesStep6 ext * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep6 ext * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java index 4f9f9aa427..59911960a8 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep7.java @@ -126,7 +126,7 @@ public interface InsertValuesStep7 * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep7 * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java index a7eac26920..2cb864ba2b 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep8.java @@ -126,7 +126,7 @@ public interface InsertValuesStep8 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep8 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java b/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java index 330c816bb3..54c08e8f24 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStep9.java @@ -126,7 +126,7 @@ public interface InsertValuesStep9 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -144,7 +144,7 @@ public interface InsertValuesStep9 - * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java b/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java index c42ea00286..d089abe657 100644 --- a/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java +++ b/jOOQ/src/main/java/org/jooq/InsertValuesStepN.java @@ -125,7 +125,7 @@ public interface InsertValuesStepN extends InsertOnDuplicateSt * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field @@ -142,7 +142,7 @@ public interface InsertValuesStepN extends InsertOnDuplicateSt * This is equivalent to calling the other values clauses multiple times, but * allows for dynamic construction of row arrays. *

- * Note: Irrespective of individual {@link Record#changed()} + * Note: Irrespective of individual {@link Record#touched()} * flag values, all record values are copied to the VALUES clause * using {@link Record#intoArray()}, to match insert columns by position, not * by name. If you prefer omitting unchanged values and adding values by field diff --git a/jOOQ/src/main/java/org/jooq/MergeMatchedSetStep.java b/jOOQ/src/main/java/org/jooq/MergeMatchedSetStep.java index 5ea1765d15..3a9eb9c1a5 100644 --- a/jOOQ/src/main/java/org/jooq/MergeMatchedSetStep.java +++ b/jOOQ/src/main/java/org/jooq/MergeMatchedSetStep.java @@ -154,8 +154,8 @@ public interface MergeMatchedSetStep { *

* This is the same as calling {@link #set(Map)} with the argument record * treated as a Map<Field<?>, Object>, except that the - * {@link Record#changed()} flags are taken into consideration in order to - * update only changed values. + * {@link Record#touched()} flags are taken into consideration in order to + * update only touched values. * * @see #set(Map) */ diff --git a/jOOQ/src/main/java/org/jooq/Record.java b/jOOQ/src/main/java/org/jooq/Record.java index e42462db64..6e121e2298 100644 --- a/jOOQ/src/main/java/org/jooq/Record.java +++ b/jOOQ/src/main/java/org/jooq/Record.java @@ -326,12 +326,12 @@ public interface Record extends Fields, Attachable, Comparable, Formatta /** * Set a value into this record, using {@link #field(Field)} for lookup. *

- * This will always set the {@link #changed(Field)} flag for the given + * This will always set the {@link #touched(Field)} flag for the given * field, no matter if setting the value actually changes the * value. *

* Changing {@link Table#getPrimaryKey()} values will set all - * {@link #changed()} flags to true, in order to produce complete + * {@link #touched()} flags to true, in order to produce complete * INSERT statements on subsequent * {@link UpdatableRecord#store()} operations. * @@ -344,12 +344,12 @@ public interface Record extends Fields, Attachable, Comparable, Formatta /** * Set a value into this record, using {@link #field(Field)} for lookup. *

- * This will always set the {@link #changed(Field)} flag for the given + * This will always set the {@link #touched(Field)} flag for the given * field, no matter if setting the value actually changes the * value. *

* Changing {@link Table#getPrimaryKey()} values will set all - * {@link #changed()} flags to true, in order to produce complete + * {@link #touched()} flags to true, in order to produce complete * INSERT statements on subsequent * {@link UpdatableRecord#store()} operations. * @@ -462,7 +462,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * @see #changed(Field) * @see #changed(int) * @see #changed(String) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched()} instead. */ + @Deprecated(forRemoval = true) boolean changed(); /** @@ -471,7 +473,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * * @see #changed() * @see #original(Field) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(Field)} instead. */ + @Deprecated(forRemoval = true) boolean changed(Field field); /** @@ -481,7 +485,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * @param fieldIndex The 0-based field index in this record. * @see #changed() * @see #original(int) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(int)} instead. */ + @Deprecated(forRemoval = true) boolean changed(int fieldIndex); /** @@ -490,7 +496,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * * @see #changed() * @see #original(String) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(String)} instead. */ + @Deprecated(forRemoval = true) boolean changed(String fieldName); /** @@ -499,7 +507,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * * @see #changed() * @see #original(Name) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(Name)} instead. */ + @Deprecated(forRemoval = true) boolean changed(Name fieldName); /** @@ -513,7 +523,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * @see #changed(Field, boolean) * @see #changed(int, boolean) * @see #changed(String, boolean) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(boolean)} instead. */ + @Deprecated(forRemoval = true) void changed(boolean changed); /** @@ -526,7 +538,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * * @see #changed() * @see #changed(Field) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(Field, boolean)} instead. */ + @Deprecated(forRemoval = true) void changed(Field field, boolean changed); /** @@ -540,7 +554,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * @param fieldIndex The 0-based field index in this record. * @see #changed() * @see #changed(int) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(int, boolean)} instead. */ + @Deprecated(forRemoval = true) void changed(int fieldIndex, boolean changed); /** @@ -553,7 +569,9 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * * @see #changed() * @see #changed(String) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(String, boolean)} instead. */ + @Deprecated(forRemoval = true) void changed(String fieldName, boolean changed); /** @@ -566,25 +584,142 @@ public interface Record extends Fields, Attachable, Comparable, Formatta * * @see #changed() * @see #changed(Name) + * @deprecated - [#12494] - 3.20.0 - Use {@link #touched(Name, boolean)} instead. */ + @Deprecated(forRemoval = true) void changed(Name fieldName, boolean changed); + /** + * Check if this record has been touched since it was created or fetched + * from the database. + * + * @see #original() + * @see #touched(Field) + * @see #touched(int) + * @see #touched(String) + */ + boolean touched(); + + /** + * Check if a field's value has been touched since the record was created or + * fetched from the database, using {@link #field(Field)} for lookup. + * + * @see #touched() + * @see #original(Field) + */ + boolean touched(Field field); + + /** + * Check if a field's value has been touched since the record was created or + * fetched from the database, using {@link #field(int)} for lookup. + * + * @param fieldIndex The 0-based field index in this record. + * @see #touched() + * @see #original(int) + */ + boolean touched(int fieldIndex); + + /** + * Check if a field's value has been touched since the record was created or + * fetched from the database, using {@link #field(String)} for lookup. + * + * @see #touched() + * @see #original(String) + */ + boolean touched(String fieldName); + + /** + * Check if a field's value has been touched since the record was created or + * fetched from the database, using {@link #field(Name)} for lookup. + * + * @see #touched() + * @see #original(Name) + */ + boolean touched(Name fieldName); + + /** + * Set all of this record's internal touched flags to the supplied value. + *

+ * If the touched argument is false, the + * {@link #original()} values will be reset to the corresponding "current" + * values as well + * + * @see #touched() + * @see #touched(Field, boolean) + * @see #touched(int, boolean) + * @see #touched(String, boolean) + */ + void touched(boolean touched); + + /** + * Set this record's internal touched flag to the supplied value for a given + * field, using {@link #field(Field)} for lookup. + *

+ * If the touched argument is false, the + * {@link #original(Field)} value will be reset to the corresponding + * "current" value as well + * + * @see #touched() + * @see #touched(Field) + */ + void touched(Field field, boolean touched); + + /** + * Set this record's internal touched flag to the supplied value for a given + * field. + *

+ * If the touched argument is false, the + * {@link #original(int)} value will be reset to the corresponding "current" + * value as well + * + * @param fieldIndex The 0-based field index in this record. + * @see #touched() + * @see #touched(int) + */ + void touched(int fieldIndex, boolean touched); + + /** + * Set this record's internal touched flag to the supplied value for a given + * field, using {@link #field(String)} for lookup. + *

+ * If the touched argument is false, the + * {@link #touched(String)} value will be reset to the corresponding + * "current" value as well + * + * @see #touched() + * @see #touched(String) + */ + void touched(String fieldName, boolean touched); + + /** + * Set this record's internal touched flag to the supplied value for a given + * field, using {@link #field(Name)} for lookup. + *

+ * If the touched argument is false, the + * {@link #original(Name)} value will be reset to the corresponding + * "current" value as well + * + * @see #touched() + * @see #touched(Name) + */ + void touched(Name fieldName, boolean touched); + /** * Reset all values to their {@link #original()} values and all - * {@link #changed()} flags to false. + * {@link #touched()} flags to false. */ void reset(); /** * Reset a given value to its {@link #original(Field)} value and its - * {@link #changed(Field)} flag to false, using + * {@link #touched(Field)} flag to false, using * {@link #field(Field)} for lookup. */ void reset(Field field); /** * Reset a given value to its {@link #original(int)} value and its - * {@link #changed(int)} flag to false. + * {@link #touched(int)} flag to false. * * @param fieldIndex The 0-based field index in this record. */ @@ -592,14 +727,14 @@ public interface Record extends Fields, Attachable, Comparable, Formatta /** * Reset a given value to its {@link #original(String)} value and its - * {@link #changed(String)} flag to false, using + * {@link #touched(String)} flag to false, using * {@link #field(String)} for lookup. */ void reset(String fieldName); /** * Reset a given value to its {@link #original(Name)} value and its - * {@link #changed(Name)} flag to false, using + * {@link #touched(Name)} flag to false, using * {@link #field(Name)} for lookup. */ void reset(Name fieldName); @@ -1085,7 +1220,7 @@ public interface Record extends Fields, Attachable, Comparable, Formatta *

*

General notes
*

- * The resulting record will have its internal "changed" flags set to true + * The resulting record will have its internal "touched" flags set to true * for all values. This means that {@link UpdatableRecord#store()} will * perform an INSERT statement. If you wish to store the record * using an UPDATE statement, use diff --git a/jOOQ/src/main/java/org/jooq/TableRecord.java b/jOOQ/src/main/java/org/jooq/TableRecord.java index 2ccb59c52c..fffd91ed20 100644 --- a/jOOQ/src/main/java/org/jooq/TableRecord.java +++ b/jOOQ/src/main/java/org/jooq/TableRecord.java @@ -68,9 +68,9 @@ public interface TableRecord> extends QualifiedRecordINSERT statement. *

* If you want to enforce re-insertion this record's values, regardless if - * the values in this record were changed, you can explicitly set the - * changed flags for all values with {@link #changed(boolean)} or for single - * values with {@link #changed(Field, boolean)}, prior to insertion. + * the values in this record were touched, you can explicitly set the + * touched flags for all values with {@link #touched(boolean)} or for single + * values with {@link #touched(Field, boolean)}, prior to insertion. * * @return 1 if the record was stored to the database. 0 * if storing was not necessary and diff --git a/jOOQ/src/main/java/org/jooq/UpdatableRecord.java b/jOOQ/src/main/java/org/jooq/UpdatableRecord.java index 243d8bb3d8..866d3f7ccd 100644 --- a/jOOQ/src/main/java/org/jooq/UpdatableRecord.java +++ b/jOOQ/src/main/java/org/jooq/UpdatableRecord.java @@ -132,14 +132,14 @@ public interface UpdatableRecord> extends TableReco *

  • If this record was created by client code, an INSERT * statement is executed
  • *
  • If this record was loaded by jOOQ and the primary key value was - * changed, an INSERT statement is executed (unless + * touched, an INSERT statement is executed (unless * {@link Settings#isUpdatablePrimaryKeys()} is set). jOOQ expects that * primary key values will never change due to the principle of * normalisation in RDBMS. So if client code changes primary key values, * this is interpreted by jOOQ as client code wanting to duplicate this * record.
  • *
  • If this record was loaded by jOOQ, and the primary key value was not - * changed, an UPDATE statement is executed.
  • + * touched, an UPDATE statement is executed. * *

    * In either statement type, only those fields are inserted/updated, which @@ -231,9 +231,9 @@ public interface UpdatableRecord> extends TableReco *

    Statement execution enforcement

    *

    * If you want to control statement re-execution, regardless if the values - * in this record were changed, you can explicitly set the changed flags for - * all values with {@link #changed(boolean)} or for single values with - * {@link #changed(Field, boolean)}, prior to storing. Consider also setting + * in this record were touched, you can explicitly set the touched flags for + * all values with {@link #touched(boolean)} or for single values with + * {@link #touched(Field, boolean)}, prior to storing. Consider also setting * the flags {@link Settings#getUpdateUnchangedRecords()} and/or * {@link Settings#isInsertUnchangedRecords()} appropriately to control if * the record should be "touched" without any changes (UPDATE) @@ -290,9 +290,9 @@ public interface UpdatableRecord> extends TableReco * statement (or no statement) will always be executed. *

    * If you want to enforce re-insertion this record's values, regardless if - * the values in this record were changed, you can explicitly set the - * changed flags for all values with {@link #changed(boolean)} or for single - * values with {@link #changed(Field, boolean)}, prior to insertion. + * the values in this record were touched, you can explicitly set the + * touched flags for all values with {@link #touched(boolean)} or for single + * values with {@link #touched(Field, boolean)}, prior to insertion. *

    * This is the same as calling record.insert(record.fields()) * @@ -340,9 +340,9 @@ public interface UpdatableRecord> extends TableReco * statement (or no statement) will always be executed. *

    * If you want to enforce statement execution, regardless if the values in - * this record were changed, you can explicitly set the changed flags for - * all values with {@link #changed(boolean)} or for single values with - * {@link #changed(Field, boolean)}, prior to updating, or alternatively, + * this record were touched, you can explicitly set the touched flags for + * all values with {@link #touched(boolean)} or for single values with + * {@link #touched(Field, boolean)}, prior to updating, or alternatively, * use {@link Settings#getUpdateUnchangedRecords()}. *

    * This is the same as calling record.update(record.fields()) @@ -401,9 +401,9 @@ public interface UpdatableRecord> extends TableReco * on whether the lock values are present already in the record. *

    * If you want to enforce statement execution, regardless if the values in - * this record were changed, you can explicitly set the changed flags for - * all values with {@link #changed(boolean)} or for single values with - * {@link #changed(Field, boolean)}, prior to insertion. + * this record were touched, you can explicitly set the touched flags for + * all values with {@link #touched(boolean)} or for single values with + * {@link #touched(Field, boolean)}, prior to insertion. *

    * This is the same as calling record.merge(record.fields()) * @@ -504,7 +504,7 @@ public interface UpdatableRecord> extends TableReco *

  • {@link #valuesRow()} will have been restored to the respective values * from the database
  • *
  • {@link #original()} will match this record
  • - *
  • {@link #changed()} will be false
  • + *
  • {@link #touched()} will be false
  • * *

    * Refreshing can trigger any of the following actions: @@ -532,7 +532,7 @@ public interface UpdatableRecord> extends TableReco *

  • {@link #valuesRow()} will have been restored to the respective values * from the database
  • *
  • {@link #original()} will match this record
  • - *
  • {@link #changed()} will be false
  • + *
  • {@link #touched()} will be false
  • * *

    * Refreshing can trigger any of the following actions: @@ -560,7 +560,7 @@ public interface UpdatableRecord> extends TableReco *

  • {@link #valuesRow()} will have been restored to the respective values * from the database
  • *
  • {@link #original()} will match this record
  • - *
  • {@link #changed()} will be false
  • + *
  • {@link #touched()} will be false
  • * *

    * Refreshing can trigger any of the following actions: diff --git a/jOOQ/src/main/java/org/jooq/UpdateSetStep.java b/jOOQ/src/main/java/org/jooq/UpdateSetStep.java index 94622e57a3..5d2b6b4399 100644 --- a/jOOQ/src/main/java/org/jooq/UpdateSetStep.java +++ b/jOOQ/src/main/java/org/jooq/UpdateSetStep.java @@ -129,8 +129,8 @@ public interface UpdateSetStep { *

    * This is the same as calling {@link #set(Map)} with the argument record * treated as a Map<Field<?>, Object>, except that the - * {@link Record#changed()} flags are taken into consideration in order to - * update only changed values. + * {@link Record#touched()} flags are taken into consideration in order to + * update only touched values. * * @see #set(Map) */ diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractField.java b/jOOQ/src/main/java/org/jooq/impl/AbstractField.java index 01650ffe4a..0848486b26 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractField.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractField.java @@ -174,6 +174,11 @@ implements return record.changed(this); } + @Override + public final boolean touched(Record record) { + return record.touched(this); + } + @Override public final void reset(Record record) { record.reset(this); diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java b/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java index f5b7254000..301eff0cbc 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractRecord.java @@ -48,7 +48,6 @@ import static org.jooq.impl.Tools.converterContext; import static org.jooq.impl.Tools.embeddedFields; import static org.jooq.impl.Tools.indexFail; import static org.jooq.impl.Tools.indexOrFail; -import static org.jooq.impl.Tools.resetChangedOnNotNull; import static org.jooq.impl.Tools.settings; import java.io.Writer; @@ -131,7 +130,7 @@ implements final AbstractRow fields; final Object[] values; final Object[] originals; - final BitSet changed; + final BitSet touched; boolean fetched; /** @@ -156,7 +155,7 @@ implements this.fields = (AbstractRow) fields; this.values = new Object[size]; this.originals = new Object[size]; - this.changed = new BitSet(size); + this.touched = new BitSet(size); } // ------------------------------------------------------------------------ @@ -319,35 +318,34 @@ implements // Normal fields' changed flag is always set to true if (key == null || !key.getFields().contains(field)) { - changed.set(index); + touched.set(index); } // The primary key's changed flag might've been set previously - else if (changed.get(index)) { - changed.set(index); + else if (touched.get(index)) { + touched.set(index); } // [#2764] Users may override updatability of primary key values else if (updatablePrimaryKeys(settings(this))) { - changed.set(index); + touched.set(index); } // [#2698] If the primary key has not yet been set else if (originals[index] == null) { - changed.set(index); + touched.set(index); } - // [#979] If the primary key is being changed, all other fields' flags + // [#979] If the primary key is being touched, all other fields' flags // need to be set to true for in case this record is stored again, an // INSERT statement will thus be issued else { - // [#945] Be sure that changed is never reset to false - changed.set(index, changed.get(index) || !StringUtils.equals(values[index], value)); + // [#945] Be sure that touched is never reset to false + touched.set(index, touched.get(index) || !StringUtils.equals(values[index], value)); - if (changed.get(index)) { - changed(true); - } + if (touched.get(index)) + touched(true); } values[index] = value; @@ -379,7 +377,7 @@ implements values[targetIndex] = record.get(sourceIndex); originals[targetIndex] = record.original(sourceIndex); - changed.set(targetIndex, record.changed(sourceIndex)); + touched.set(targetIndex, record.touched(sourceIndex)); } } @@ -432,33 +430,93 @@ implements } @Override + @Deprecated public final boolean changed() { - return !changed.isEmpty(); + return touched(); } @Override + @Deprecated public final boolean changed(Field field) { - return changed(indexOrFail(fields, field)); + return touched(field); } @Override + @Deprecated public final boolean changed(int fieldIndex) { - return changed.get(safeIndex(fieldIndex)); + return touched(fieldIndex); } @Override + @Deprecated public final boolean changed(String fieldName) { - return changed(indexOrFail(fields, fieldName)); + return touched(fieldName); } @Override + @Deprecated public final boolean changed(Name fieldName) { - return changed(indexOrFail(fields, fieldName)); + return touched(fieldName); } @Override + @Deprecated public final void changed(boolean c) { - changed.set(0, values.length, c); + touched(c); + } + + @Override + @Deprecated + public final void changed(Field field, boolean c) { + touched(field, c); + } + + @Override + @Deprecated + public final void changed(int fieldIndex, boolean c) { + touched(fieldIndex, c); + } + + @Override + @Deprecated + public final void changed(String fieldName, boolean c) { + touched(fieldName, c); + } + + @Override + @Deprecated + public final void changed(Name fieldName, boolean c) { + touched(fieldName, c); + } + + @Override + public final boolean touched() { + return !touched.isEmpty(); + } + + @Override + public final boolean touched(Field field) { + return touched(indexOrFail(fields, field)); + } + + @Override + public final boolean touched(int fieldIndex) { + return touched.get(safeIndex(fieldIndex)); + } + + @Override + public final boolean touched(String fieldName) { + return touched(indexOrFail(fields, fieldName)); + } + + @Override + public final boolean touched(Name fieldName) { + return touched(indexOrFail(fields, fieldName)); + } + + @Override + public final void touched(boolean c) { + touched.set(0, values.length, c); // [#1995] If a value is meant to be "unchanged", the "original" should // match the supposedly "unchanged" value. @@ -468,15 +526,15 @@ implements } @Override - public final void changed(Field field, boolean c) { - changed(indexOrFail(fields, field), c); + public final void touched(Field field, boolean c) { + touched(indexOrFail(fields, field), c); } @Override - public final void changed(int fieldIndex, boolean c) { + public final void touched(int fieldIndex, boolean c) { safeIndex(fieldIndex); - changed.set(fieldIndex, c); + touched.set(fieldIndex, c); // [#1995] If a value is meant to be "unchanged", the "original" should // match the supposedly "unchanged" value. @@ -485,18 +543,18 @@ implements } @Override - public final void changed(String fieldName, boolean c) { - changed(indexOrFail(fields, fieldName), c); + public final void touched(String fieldName, boolean c) { + touched(indexOrFail(fields, fieldName), c); } @Override - public final void changed(Name fieldName, boolean c) { - changed(indexOrFail(fields, fieldName), c); + public final void touched(Name fieldName, boolean c) { + touched(indexOrFail(fields, fieldName), c); } @Override public final void reset() { - changed.clear(); + touched.clear(); System.arraycopy(originals, 0, values, 0, originals.length); } @@ -510,7 +568,7 @@ implements public final void reset(int fieldIndex) { safeIndex(fieldIndex); - changed.clear(fieldIndex); + touched.clear(fieldIndex); values[fieldIndex] = originals[fieldIndex]; } @@ -748,7 +806,7 @@ implements t.values[targetIndex] = targetType.convert(values[sourceIndex]); t.originals[targetIndex] = targetType.convert(originals[sourceIndex]); - t.changed.set(targetIndex, changed.get(sourceIndex)); + t.touched.set(targetIndex, touched.get(sourceIndex)); } } } @@ -793,14 +851,24 @@ implements // [#2700] [#3582] If a POJO attribute is NULL, but the column is NOT NULL // then we should let the database apply DEFAULT values - Tools.resetChangedOnNotNull(this); + Tools.resetTouchedOnNotNull(this); + } + + /** + * Generated subclasses may call this method. + * + * @deprecated - [#12494] - 3.20.0 - Please re-generate your code + */ + @Deprecated + protected /* non-final */ void resetChangedOnNotNull() { + resetTouchedOnNotNull(); } /** * Generated subclasses may call this method. */ - protected /* non-final */ void resetChangedOnNotNull() { - Tools.resetChangedOnNotNull(this); + protected /* non-final */ void resetTouchedOnNotNull() { + Tools.resetTouchedOnNotNull(this); } private final Object prepareArrayOrIterableForUnmap(Object source, int[] targetIndexMapping) { @@ -918,7 +986,7 @@ implements for (Field field : fields.fields.fields) { Field sourceField = source.field(field); - if (sourceField != null && source.changed(sourceField)) + if (sourceField != null && source.touched(sourceField)) Tools.setValue(this, field, source, sourceField, cc); } } @@ -931,7 +999,7 @@ implements int j = indexMapping == null ? i : indexMapping[i]; // [#12697] Don't re-apply data type conversion, assuming it already happened - if (source.field(j) != null && source.changed(j)) + if (source.field(j) != null && source.touched(j)) set((Field) field(j), j, source.get(j)); } } diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractResult.java b/jOOQ/src/main/java/org/jooq/impl/AbstractResult.java index 58172753bc..7e091e9ec2 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractResult.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractResult.java @@ -173,7 +173,7 @@ abstract class AbstractResult extends AbstractFormattable impl // Collect all decimal places for the column values for (R record : buffer) - decimalPlacesList.add(decimalPlaces(format0(record.get(index), record.changed(index), true))); + decimalPlacesList.add(decimalPlaces(format0(record.get(index), record.touched(index), true))); // Find max decimalPlaces[index] = Collections.max(decimalPlacesList); @@ -197,7 +197,7 @@ abstract class AbstractResult extends AbstractFormattable impl // Add column values width for (R record : buffer) { - String value = format0(record.get(index), record.changed(index), true); + String value = format0(record.get(index), record.touched(index), true); // Align number values before width is calculated if (isNumCol) @@ -283,7 +283,7 @@ abstract class AbstractResult extends AbstractFormattable impl StringUtils.replace( StringUtils.replace( StringUtils.replace( - format0(record.get(index), record.changed(index), true), "\n", "{lf}" + format0(record.get(index), record.touched(index), true), "\n", "{lf}" ), "\r", "{cr}" ), "\t", "{tab}" ); @@ -1402,10 +1402,10 @@ abstract class AbstractResult extends AbstractFormattable impl * @param visual Whether the formatted output is to be consumed visually * (HTML, TEXT) or by a machine (CSV, JSON, XML) */ - static final String format0(Object value, boolean changed, boolean visual) { + static final String format0(Object value, boolean touched, boolean visual) { // [#2741] TODO: This logic will be externalised in new SPI - String formatted = changed && visual ? "*" : ""; + String formatted = touched && visual ? "*" : ""; if (value == null) { formatted += visual ? "{null}" : null; diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractStoreQuery.java b/jOOQ/src/main/java/org/jooq/impl/AbstractStoreQuery.java index f1a4c5dcdc..abf3f3d2a7 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractStoreQuery.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractStoreQuery.java @@ -73,7 +73,7 @@ implements @Override public final void setRecord(R record) { for (int i = 0; i < record.size(); i++) - if (record.changed(i)) + if (record.touched(i)) addValue((Field) record.field(i), record.get(i)); } diff --git a/jOOQ/src/main/java/org/jooq/impl/BatchCRUD.java b/jOOQ/src/main/java/org/jooq/impl/BatchCRUD.java index fb2bdfa85c..4008521729 100644 --- a/jOOQ/src/main/java/org/jooq/impl/BatchCRUD.java +++ b/jOOQ/src/main/java/org/jooq/impl/BatchCRUD.java @@ -256,7 +256,7 @@ final class BatchCRUD extends AbstractBatch { // calls to store() will insert them again // 2. Stored records should be marked as unchanged for (TableRecord record : records) { - record.changed(action == Action.DELETE); + record.touched(action == Action.DELETE); // [#3362] If new records (fetched = false) are batch-stored twice in a row, the second // batch-store needs to generate an UPDATE statement. diff --git a/jOOQ/src/main/java/org/jooq/impl/DAOImpl.java b/jOOQ/src/main/java/org/jooq/impl/DAOImpl.java index 3beb8c07e9..81edcee017 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DAOImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/DAOImpl.java @@ -479,9 +479,9 @@ public abstract class DAOImpl, P, T> implements DAO if (forUpdate && pk != null) for (Field field : pk) - record.changed(field, false); + record.touched(field, false); - Tools.resetChangedOnNotNull(record); + Tools.resetTouchedOnNotNull(record); result.add(record); } diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java b/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java index 7dffbcb4d9..57ccb6f432 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java @@ -4393,7 +4393,7 @@ public class DefaultBinding implements Binding { DefaultBindingGetResultSetContext c = new DefaultBindingGetResultSetContext<>(ctx.executeContext(), ctx.resultSet(), ctx.index()); r.field(0).getBinding().get((BindingGetResultSetContext) c); r.fromArray(c.value()); - r.changed(false); + r.touched(false); return r; })); } @@ -4592,7 +4592,7 @@ public class DefaultBinding implements Binding { for (int i = 0; i < row.size(); i++) pgSetValue(ctx, r, row.field(i), values.get(i)); - r.changed(false); + r.touched(false); return r; }); } @@ -4753,7 +4753,7 @@ public class DefaultBinding implements Binding { result.add(newRecord(true, recordType, row, c).operate(r -> { r.from(asList(s)); - r.changed(false); + r.touched(false); return r; })); diff --git a/jOOQ/src/main/java/org/jooq/impl/HistoryRecord.java b/jOOQ/src/main/java/org/jooq/impl/HistoryRecord.java index 8e0a28eeb8..7dab0c90e4 100644 --- a/jOOQ/src/main/java/org/jooq/impl/HistoryRecord.java +++ b/jOOQ/src/main/java/org/jooq/impl/HistoryRecord.java @@ -277,6 +277,6 @@ class HistoryRecord extends UpdatableRecordImpl { setStatusMessage(statusMessage); setResolution(resolution); setResolutionMessage(resolutionMessage); - resetChangedOnNotNull(); + resetTouchedOnNotNull(); } } diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java index ac3cfcb3cc..8eae146c2c 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java @@ -1239,7 +1239,7 @@ final class InsertImpl { else r.fromMap(record); - r.changed(false); + r.touched(false); return r; })); } @@ -220,7 +220,7 @@ final class JSONReader { else result.add(newRecord(true, recordType, actualRow, ctx.configuration()).operate(r -> { r.from(record); - r.changed(false); + r.touched(false); return r; })); } @@ -299,7 +299,7 @@ final class JSONReader { record.set(i, newRecord(true, recordType, actualRow, ctx.configuration()).operate(r -> { r.from(l); - r.changed(false); + r.touched(false); return r; })); } diff --git a/jOOQ/src/main/java/org/jooq/impl/ListHandler.java b/jOOQ/src/main/java/org/jooq/impl/ListHandler.java index 704febda99..2772f8fbca 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ListHandler.java +++ b/jOOQ/src/main/java/org/jooq/impl/ListHandler.java @@ -97,7 +97,7 @@ final class ListHandler { } r.fromArray(attributes); - r.changed(false); + r.touched(false); return r; } else diff --git a/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java b/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java index c4ec1c5062..98189c6c94 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/MergeImpl.java @@ -1020,7 +1020,7 @@ implements @Override public final MergeImpl set(Record record) { - return set(Tools.mapOfChangedValues(record)); + return set(Tools.mapOfTouchedValues(record)); } @Override diff --git a/jOOQ/src/main/java/org/jooq/impl/MigrationImpl.java b/jOOQ/src/main/java/org/jooq/impl/MigrationImpl.java index 3b76294e9f..22a167c604 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MigrationImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/MigrationImpl.java @@ -394,7 +394,7 @@ final class MigrationImpl extends AbstractScope implements Migration { HistoryRecord record = history.currentHistoryRecord(false); if (record == null || !StringUtils.equals(e.record.getId(), record.getId())) { - e.record.changed(true); + e.record.touched(true); e.record.insert(); } diff --git a/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java b/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java index 757eb85264..0460727a1f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/TableRecordImpl.java @@ -180,7 +180,7 @@ implements final int storeInsert0(Field[] storeFields) { DSLContext create = create(); InsertQuery insert = create.insertQuery(getTable()); - List> changedFields = addChangedValues(storeFields, insert, false); + List> changedFields = addTouchedValues(storeFields, insert, false); if (changedFields.isEmpty()) { @@ -209,7 +209,7 @@ implements if (result > 0) { for (Field changedField : changedFields) - changed(changedField, false); + touched(changedField, false); // [#1596] If insert was successful, update timestamp and/or version columns setRecordVersionAndTimestamp(version, timestamp); @@ -289,7 +289,7 @@ implements values[fieldIndex] = value; originals[fieldIndex] = value; - changed.clear(fieldIndex); + touched.clear(fieldIndex); } if (timestamp != null) { TableField field = getTable().getRecordTimestamp(); @@ -298,19 +298,19 @@ implements values[fieldIndex] = value; originals[fieldIndex] = value; - changed.clear(fieldIndex); + touched.clear(fieldIndex); } } /** - * Set all changed values of this record to a store query. + * Set all touched values of this record to a store query. */ - final List> addChangedValues(Field[] storeFields, StoreQuery query, boolean forUpdate) { + final List> addTouchedValues(Field[] storeFields, StoreQuery query, boolean forUpdate) { FieldsImpl f = new FieldsImpl<>(storeFields); List> result = new ArrayList<>(); for (Field field : fields.fields.fields) { - if (changed(field) && f.field(field) != null && writable(field, forUpdate)) { + if (touched(field) && f.field(field) != null && writable(field, forUpdate)) { addValue(query, field, forUpdate); result.add(field); } diff --git a/jOOQ/src/main/java/org/jooq/impl/Tools.java b/jOOQ/src/main/java/org/jooq/impl/Tools.java index 9fe26910c3..06913706b9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Tools.java +++ b/jOOQ/src/main/java/org/jooq/impl/Tools.java @@ -1574,13 +1574,13 @@ final class Tools { * [#2700] [#3582] If a POJO attribute is NULL, but the column is NOT NULL * then we should let the database apply DEFAULT values */ - static final void resetChangedOnNotNull(Record record) { + static final void resetTouchedOnNotNull(Record record) { int size = record.size(); for (int i = 0; i < size; i++) if (record.get(i) == null) if (!record.field(i).getDataType().nullable()) - record.changed(i, false); + record.touched(i, false); } /** @@ -2790,12 +2790,12 @@ final class Tools { /** * Turn a {@link Record} into a {@link Map} */ - static final Map, Object> mapOfChangedValues(Record record) { + static final Map, Object> mapOfTouchedValues(Record record) { Map, Object> result = new LinkedHashMap<>(); int size = record.size(); for (int i = 0; i < size; i++) - if (record.changed(i)) + if (record.touched(i)) result.put(record.field(i), record.get(i)); return result; @@ -3748,7 +3748,7 @@ final class Tools { target.values[targetIndex] = targetType.convert(source.get(sourceIndex)); target.originals[targetIndex] = targetType.convert(source.original(sourceIndex)); - target.changed.set(targetIndex, source.changed(sourceIndex)); + target.touched.set(targetIndex, source.touched(sourceIndex)); } /** @@ -4291,7 +4291,7 @@ final class Tools { */ static final void addCondition(org.jooq.ConditionProvider provider, Record record, Field field) { - // [#2764] If primary keys are allowed to be changed, the + // [#2764] If primary keys are allowed to be touched, the if (updatablePrimaryKeys(settings(record))) provider.addConditions(condition(field, record.original(field))); else diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java index e32b72e8a1..c2f70af4f5 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java @@ -206,8 +206,8 @@ public class UpdatableRecordImpl> extends TableReco else { for (TableField field : keys) { - // If any primary key value is null or changed - if (changed(field) || + // If any primary key value is null or touched + if (touched(field) || // [#3237] or if a NOT NULL primary key value is null, then execute an INSERT (field.getDataType().nullable() == false && get(field) == null)) { @@ -294,13 +294,13 @@ public class UpdatableRecordImpl> extends TableReco Q query, boolean merge ) { - List> changedFields = addChangedValues(storeFields, query, merge); + List> touchedFields = addTouchedValues(storeFields, query, merge); // [#11552] These conditions should be omitted in the MERGE case if (!merge) Tools.addConditions(query, this, keys); - if (changedFields.isEmpty()) { + if (touchedFields.isEmpty()) { switch (StringUtils.defaultIfNull(create().settings().getUpdateUnchangedRecords(), UpdateUnchangedRecords.NEVER)) { // Don't store records if no value was set by client code @@ -326,9 +326,9 @@ public class UpdatableRecordImpl> extends TableReco case SET_NON_PRIMARY_KEY_TO_RECORD_VALUES: for (Field field : storeFields) if (!asList(keys).contains(field)) - changed(field, true); + touched(field, true); - addChangedValues(storeFields, query, merge); + addTouchedValues(storeFields, query, merge); break; } } @@ -362,8 +362,8 @@ public class UpdatableRecordImpl> extends TableReco checkIfChanged(result, version, timestamp); if (result > 0) { - for (Field changedField : changedFields) - changed(changedField, false); + for (Field touchedField : touchedFields) + touched(touchedField, false); // [#1859] If an update was successful try fetching the generated getReturningIfNeeded(query, key); @@ -420,7 +420,7 @@ public class UpdatableRecordImpl> extends TableReco // [#673] [#3363] If store() is called after delete(), a new INSERT should // be executed and the record should be recreated finally { - changed(true); + touched(true); fetched = false; } } diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java index a3a15aaf49..15f2acee62 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java @@ -178,7 +178,7 @@ implements @Override public final UpdateImpl set(Record record) { - return set(Tools.mapOfChangedValues(record)); + return set(Tools.mapOfTouchedValues(record)); } diff --git a/jOOQ/src/main/java/org/jooq/impl/XMLHandler.java b/jOOQ/src/main/java/org/jooq/impl/XMLHandler.java index 509ac8a284..3877ed989d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/XMLHandler.java +++ b/jOOQ/src/main/java/org/jooq/impl/XMLHandler.java @@ -124,7 +124,7 @@ final class XMLHandler extends DefaultHandler { } r.from(values); - r.changed(false); + r.touched(false); return r; } } diff --git a/jOOQ/src/main/java/org/jooq/tools/LoggerListener.java b/jOOQ/src/main/java/org/jooq/tools/LoggerListener.java index 9849e86d2a..6ec3bc0da9 100644 --- a/jOOQ/src/main/java/org/jooq/tools/LoggerListener.java +++ b/jOOQ/src/main/java/org/jooq/tools/LoggerListener.java @@ -257,7 +257,7 @@ public class LoggerListener implements ExecuteListener { for (Parameter param : routine.getOutParameters()) result.setValue((Field) fields.get(i++), routine.getValue(param)); - result.changed(false); + result.touched(false); } return result; diff --git a/pom.xml b/pom.xml index f0b362e74b..8e480bbc5d 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 2.3.232 3.46.1.0 - 1.1.0 + 1.0.0 10.14.2.0 2.7.2