[jOOQ/jOOQ#10824] Stop using information_schema.table_constraints in PostgresDatabase

This commit is contained in:
Lukas Eder 2020-11-05 14:16:51 +01:00
parent 2f5cf12064
commit b69cc3eba3
39 changed files with 110 additions and 334 deletions

View File

@ -73,7 +73,6 @@ import static org.jooq.meta.postgres.information_schema.Tables.PARAMETERS;
import static org.jooq.meta.postgres.information_schema.Tables.ROUTINES;
import static org.jooq.meta.postgres.information_schema.Tables.SEQUENCES;
import static org.jooq.meta.postgres.information_schema.Tables.TABLES;
import static org.jooq.meta.postgres.information_schema.Tables.TABLE_CONSTRAINTS;
import static org.jooq.meta.postgres.information_schema.Tables.VIEWS;
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_CLASS;
import static org.jooq.meta.postgres.pg_catalog.Tables.PG_CONSTRAINT;
@ -143,8 +142,8 @@ import org.jooq.meta.TableDefinition;
import org.jooq.meta.UDTDefinition;
import org.jooq.meta.hsqldb.HSQLDBDatabase;
import org.jooq.meta.postgres.information_schema.tables.CheckConstraints;
import org.jooq.meta.postgres.information_schema.tables.KeyColumnUsage;
import org.jooq.meta.postgres.information_schema.tables.Routines;
import org.jooq.meta.postgres.information_schema.tables.TableConstraints;
import org.jooq.meta.postgres.pg_catalog.tables.PgClass;
import org.jooq.meta.postgres.pg_catalog.tables.PgConstraint;
import org.jooq.meta.postgres.pg_catalog.tables.PgIndex;
@ -179,6 +178,7 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat
PgIndex i = PG_INDEX.as("i");
PgClass trel = PG_CLASS.as("trel");
PgConstraint c = PG_CONSTRAINT.as("c");
indexLoop:
for (Record6<String, String, String, Boolean, String[], Integer[]> record : create()
@ -200,8 +200,7 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat
.and(getIncludeSystemIndexes()
? noCondition()
: row(trel.pgNamespace().NSPNAME, i.indexClass().RELNAME).notIn(
select(TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA, TABLE_CONSTRAINTS.CONSTRAINT_NAME)
.from(TABLE_CONSTRAINTS)
select(c.pgNamespace().NSPNAME, c.CONNAME).from(c)
))
.orderBy(1, 2, 3)) {
@ -290,31 +289,39 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat
@Override
public ResultQuery<Record6<String, String, String, String, String, Integer>> primaryKeys(List<String> schemas) {
return keys(schemas, inline("PRIMARY KEY"));
return keys(schemas, inline("p"));
}
@Override
public ResultQuery<Record6<String, String, String, String, String, Integer>> uniqueKeys(List<String> schemas) {
return keys(schemas, inline("UNIQUE"));
return keys(schemas, inline("u"));
}
private ResultQuery<Record6<String, String, String, String, String, Integer>> keys(List<String> schemas, Field<String> constraintType) {
KeyColumnUsage k = KEY_COLUMN_USAGE.as("k");
PgConstraint c = PG_CONSTRAINT.as("c");
return create()
.select(
KEY_COLUMN_USAGE.TABLE_CATALOG,
KEY_COLUMN_USAGE.TABLE_SCHEMA,
KEY_COLUMN_USAGE.TABLE_NAME,
KEY_COLUMN_USAGE.CONSTRAINT_NAME,
KEY_COLUMN_USAGE.COLUMN_NAME,
KEY_COLUMN_USAGE.ORDINAL_POSITION)
.from(KEY_COLUMN_USAGE)
.where(KEY_COLUMN_USAGE.tableConstraints().CONSTRAINT_TYPE.eq(constraintType))
.and(KEY_COLUMN_USAGE.tableConstraints().TABLE_SCHEMA.in(schemas))
k.TABLE_CATALOG,
k.TABLE_SCHEMA,
k.TABLE_NAME,
k.CONSTRAINT_NAME,
k.COLUMN_NAME,
k.ORDINAL_POSITION)
.from(c)
.join(k)
.on(k.TABLE_SCHEMA.eq(c.pgClass().pgNamespace().NSPNAME))
.and(k.TABLE_NAME.eq(c.pgClass().RELNAME))
.and(k.CONSTRAINT_SCHEMA.eq(c.pgNamespace().NSPNAME))
.and(k.CONSTRAINT_NAME.eq(c.CONNAME))
.where(c.CONTYPE.eq(constraintType))
.and(c.pgNamespace().NSPNAME.in(schemas))
.orderBy(
KEY_COLUMN_USAGE.TABLE_SCHEMA.asc(),
KEY_COLUMN_USAGE.TABLE_NAME.asc(),
KEY_COLUMN_USAGE.CONSTRAINT_NAME.asc(),
KEY_COLUMN_USAGE.ORDINAL_POSITION.asc());
k.TABLE_SCHEMA.asc(),
k.TABLE_NAME.asc(),
k.CONSTRAINT_NAME.asc(),
k.ORDINAL_POSITION.asc());
}
@Override
@ -364,48 +371,44 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat
@Override
protected void loadCheckConstraints(DefaultRelations relations) throws SQLException {
TableConstraints tc = TABLE_CONSTRAINTS.as("tc");
CheckConstraints cc = CHECK_CONSTRAINTS.as("cc");
PgNamespace pn = PG_NAMESPACE.as("pn");
PgClass pt = PG_CLASS.as("pt");
PgConstraint pc = PG_CONSTRAINT.as("pc");
for (Record record : create()
.select(
pn.NSPNAME.as(tc.TABLE_SCHEMA),
pt.RELNAME.as(tc.TABLE_NAME),
pc.pgClass().pgNamespace().NSPNAME,
pc.pgClass().RELNAME,
pc.CONNAME.as(cc.CONSTRAINT_NAME),
replace(field("pg_get_constraintdef({0}.oid)", VARCHAR, pc), inline("CHECK "), inline("")).as(cc.CHECK_CLAUSE))
.from(pn)
.join(pt).on(pn.OID.eq(pt.RELNAMESPACE))
.join(pc).on(pt.OID.eq(pc.CONRELID))
.where(pn.NSPNAME.in(getInputSchemata()))
.from(pc)
.where(pc.pgClass().pgNamespace().NSPNAME.in(getInputSchemata()))
.and(pc.CONTYPE.eq(inline("c")))
.unionAll(
getIncludeSystemCheckConstraints()
? select(
tc.TABLE_SCHEMA,
tc.TABLE_NAME,
pc.pgClass().pgNamespace().NSPNAME,
pc.pgClass().RELNAME,
cc.CONSTRAINT_NAME,
cc.CHECK_CLAUSE
)
.from(tc)
.from(pc)
.join(cc)
.using(tc.CONSTRAINT_CATALOG, tc.CONSTRAINT_SCHEMA, tc.CONSTRAINT_NAME)
.where(tc.TABLE_SCHEMA.in(getInputSchemata()))
.and(row(tc.TABLE_SCHEMA, tc.TABLE_NAME, cc.CONSTRAINT_NAME).notIn(
select(pn.NSPNAME, pt.RELNAME, pc.CONNAME)
.on(pc.CONNAME.eq(cc.CONSTRAINT_NAME))
.and(pc.pgNamespace().NSPNAME.eq(cc.CONSTRAINT_NAME))
.where(pc.pgNamespace().NSPNAME.in(getInputSchemata()))
.and(row(pc.pgClass().pgNamespace().NSPNAME, pc.pgClass().RELNAME, cc.CONSTRAINT_NAME).notIn(
select(
pc.pgClass().pgNamespace().NSPNAME,
pc.pgClass().RELNAME,
pc.CONNAME)
.from(pc)
.join(pt).on(pc.CONRELID.eq(oid(pt)))
.join(pn).on(pc.CONNAMESPACE.eq(oid(pn)))
.where(pc.CONTYPE.eq(inline("c")))
))
: select(inline(""), inline(""), inline(""), inline("")).where(falseCondition()))
.orderBy(1, 2, 3)
) {
SchemaDefinition schema = getSchema(record.get(tc.TABLE_SCHEMA));
TableDefinition table = getTable(schema, record.get(tc.TABLE_NAME));
SchemaDefinition schema = getSchema(record.get(pc.pgClass().pgNamespace().NSPNAME));
TableDefinition table = getTable(schema, record.get(pc.pgClass().RELNAME));
if (table != null) {
relations.addCheckConstraint(table, new DefaultCheckConstraintDefinition(

View File

@ -17,7 +17,7 @@ import org.jooq.impl.CatalogImpl;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DefaultCatalog extends CatalogImpl {
private static final long serialVersionUID = 1692669599;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>DEFAULT_CATALOG</code>

View File

@ -21,7 +21,6 @@ import org.jooq.meta.postgres.information_schema.tables.ReferentialConstraints;
import org.jooq.meta.postgres.information_schema.tables.Routines;
import org.jooq.meta.postgres.information_schema.tables.Schemata;
import org.jooq.meta.postgres.information_schema.tables.Sequences;
import org.jooq.meta.postgres.information_schema.tables.TableConstraints;
import org.jooq.meta.postgres.information_schema.tables.Tables;
import org.jooq.meta.postgres.information_schema.tables.Views;
@ -32,7 +31,7 @@ import org.jooq.meta.postgres.information_schema.tables.Views;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class InformationSchema extends SchemaImpl {
private static final long serialVersionUID = -424520553;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema</code>
@ -94,11 +93,6 @@ public class InformationSchema extends SchemaImpl {
*/
public final Sequences SEQUENCES = Sequences.SEQUENCES;
/**
* The table <code>information_schema.table_constraints</code>.
*/
public final TableConstraints TABLE_CONSTRAINTS = TableConstraints.TABLE_CONSTRAINTS;
/**
* The table <code>information_schema.tables</code>.
*/
@ -136,7 +130,6 @@ public class InformationSchema extends SchemaImpl {
Routines.ROUTINES,
Schemata.SCHEMATA,
Sequences.SEQUENCES,
TableConstraints.TABLE_CONSTRAINTS,
Tables.TABLES,
Views.VIEWS);
}

View File

@ -11,13 +11,9 @@ import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.Internal;
import org.jooq.meta.postgres.information_schema.tables.CheckConstraints;
import org.jooq.meta.postgres.information_schema.tables.KeyColumnUsage;
import org.jooq.meta.postgres.information_schema.tables.Parameters;
import org.jooq.meta.postgres.information_schema.tables.ReferentialConstraints;
import org.jooq.meta.postgres.information_schema.tables.Routines;
import org.jooq.meta.postgres.information_schema.tables.Domains;
import org.jooq.meta.postgres.information_schema.tables.Schemata;
import org.jooq.meta.postgres.information_schema.tables.Sequences;
import org.jooq.meta.postgres.information_schema.tables.TableConstraints;
import org.jooq.meta.postgres.information_schema.tables.Tables;
import org.jooq.meta.postgres.information_schema.tables.Views;
@ -33,21 +29,16 @@ public class Keys {
// UNIQUE and PRIMARY KEY definitions
// -------------------------------------------------------------------------
public static final UniqueKey<Record> SYNTHETIC_PK_ROUTINES = Internal.createUniqueKey(Routines.ROUTINES, DSL.name("SYNTHETIC_PK_routines"), new TableField[] { Routines.ROUTINES.SPECIFIC_CATALOG, Routines.ROUTINES.SPECIFIC_SCHEMA, Routines.ROUTINES.SPECIFIC_NAME }, true);
public static final UniqueKey<Record> SYNTHETIC_PK_CHECK_CONSTRAINTS = Internal.createUniqueKey(CheckConstraints.CHECK_CONSTRAINTS, DSL.name("SYNTHETIC_PK_check_constraints"), new TableField[] { CheckConstraints.CHECK_CONSTRAINTS.CONSTRAINT_CATALOG, CheckConstraints.CHECK_CONSTRAINTS.CONSTRAINT_SCHEMA, CheckConstraints.CHECK_CONSTRAINTS.CONSTRAINT_NAME }, true);
public static final UniqueKey<Record> SYNTHETIC_PK_DOMAINS = Internal.createUniqueKey(Domains.DOMAINS, DSL.name("SYNTHETIC_PK_domains"), new TableField[] { Domains.DOMAINS.DOMAIN_CATALOG, Domains.DOMAINS.DOMAIN_SCHEMA, Domains.DOMAINS.DOMAIN_NAME }, true);
public static final UniqueKey<Record> SYNTHETIC_PK_SCHEMATA = Internal.createUniqueKey(Schemata.SCHEMATA, DSL.name("SYNTHETIC_PK_schemata"), new TableField[] { Schemata.SCHEMATA.CATALOG_NAME, Schemata.SCHEMATA.SCHEMA_NAME }, true);
public static final UniqueKey<Record> SYNTHETIC_PK_SEQUENCES = Internal.createUniqueKey(Sequences.SEQUENCES, DSL.name("SYNTHETIC_PK_sequences"), new TableField[] { Sequences.SEQUENCES.SEQUENCE_CATALOG, Sequences.SEQUENCES.SEQUENCE_SCHEMA, Sequences.SEQUENCES.SEQUENCE_NAME }, true);
public static final UniqueKey<Record> SYNTHETIC_PK_TABLE_CONSTRAINTS = Internal.createUniqueKey(TableConstraints.TABLE_CONSTRAINTS, DSL.name("SYNTHETIC_PK_table_constraints"), new TableField[] { TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_CATALOG, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_NAME }, true);
public static final UniqueKey<Record> SYNTHETIC_PK_TABLES = Internal.createUniqueKey(Tables.TABLES, DSL.name("SYNTHETIC_PK_tables"), new TableField[] { Tables.TABLES.TABLE_CATALOG, Tables.TABLES.TABLE_SCHEMA, Tables.TABLES.TABLE_NAME }, true);
// -------------------------------------------------------------------------
// FOREIGN KEY definitions
// -------------------------------------------------------------------------
public static final ForeignKey<Record, Record> CHECK_CONSTRAINTS__SYNTHETIC_FK_CHECK_CONSTRAINTS__SYNTHETIC_PK_TABLE_CONSTRAINTS = Internal.createForeignKey(CheckConstraints.CHECK_CONSTRAINTS, DSL.name("SYNTHETIC_FK_check_constraints__SYNTHETIC_PK_table_constraints"), new TableField[] { CheckConstraints.CHECK_CONSTRAINTS.CONSTRAINT_CATALOG, CheckConstraints.CHECK_CONSTRAINTS.CONSTRAINT_SCHEMA, CheckConstraints.CHECK_CONSTRAINTS.CONSTRAINT_NAME }, Keys.SYNTHETIC_PK_TABLE_CONSTRAINTS, new TableField[] { TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_CATALOG, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_NAME }, true);
public static final ForeignKey<Record, Record> KEY_COLUMN_USAGE__SYNTHETIC_FK_KEY_COLUMN_USAGE__SYNTHETIC_PK_TABLE_CONSTRAINTS = Internal.createForeignKey(KeyColumnUsage.KEY_COLUMN_USAGE, DSL.name("SYNTHETIC_FK_key_column_usage__SYNTHETIC_PK_table_constraints"), new TableField[] { KeyColumnUsage.KEY_COLUMN_USAGE.CONSTRAINT_CATALOG, KeyColumnUsage.KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA, KeyColumnUsage.KEY_COLUMN_USAGE.CONSTRAINT_NAME }, Keys.SYNTHETIC_PK_TABLE_CONSTRAINTS, new TableField[] { TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_CATALOG, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_NAME }, true);
public static final ForeignKey<Record, Record> PARAMETERS__SYNTHETIC_FK_PARAMETERS__SYNTHETIC_PK_ROUTINES = Internal.createForeignKey(Parameters.PARAMETERS, DSL.name("SYNTHETIC_FK_parameters__SYNTHETIC_PK_routines"), new TableField[] { Parameters.PARAMETERS.SPECIFIC_CATALOG, Parameters.PARAMETERS.SPECIFIC_SCHEMA, Parameters.PARAMETERS.SPECIFIC_NAME }, Keys.SYNTHETIC_PK_ROUTINES, new TableField[] { Routines.ROUTINES.SPECIFIC_CATALOG, Routines.ROUTINES.SPECIFIC_SCHEMA, Routines.ROUTINES.SPECIFIC_NAME }, true);
public static final ForeignKey<Record, Record> REFERENTIAL_CONSTRAINTS__REFERENCED_CONSTRAINT = Internal.createForeignKey(ReferentialConstraints.REFERENTIAL_CONSTRAINTS, DSL.name("REFERENCED_CONSTRAINT"), new TableField[] { ReferentialConstraints.REFERENTIAL_CONSTRAINTS.UNIQUE_CONSTRAINT_CATALOG, ReferentialConstraints.REFERENTIAL_CONSTRAINTS.UNIQUE_CONSTRAINT_SCHEMA, ReferentialConstraints.REFERENTIAL_CONSTRAINTS.UNIQUE_CONSTRAINT_NAME }, Keys.SYNTHETIC_PK_TABLE_CONSTRAINTS, new TableField[] { TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_CATALOG, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_NAME }, true);
public static final ForeignKey<Record, Record> REFERENTIAL_CONSTRAINTS__REFERENCING_CONSTRAINT = Internal.createForeignKey(ReferentialConstraints.REFERENTIAL_CONSTRAINTS, DSL.name("REFERENCING_CONSTRAINT"), new TableField[] { ReferentialConstraints.REFERENTIAL_CONSTRAINTS.CONSTRAINT_CATALOG, ReferentialConstraints.REFERENTIAL_CONSTRAINTS.CONSTRAINT_SCHEMA, ReferentialConstraints.REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME }, Keys.SYNTHETIC_PK_TABLE_CONSTRAINTS, new TableField[] { TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_CATALOG, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA, TableConstraints.TABLE_CONSTRAINTS.CONSTRAINT_NAME }, true);
public static final ForeignKey<Record, Record> SEQUENCES__SYNTHETIC_FK_SEQUENCES__SYNTHETIC_PK_SCHEMATA = Internal.createForeignKey(Sequences.SEQUENCES, DSL.name("SYNTHETIC_FK_sequences__SYNTHETIC_PK_schemata"), new TableField[] { Sequences.SEQUENCES.SEQUENCE_CATALOG, Sequences.SEQUENCES.SEQUENCE_SCHEMA }, Keys.SYNTHETIC_PK_SCHEMATA, new TableField[] { Schemata.SCHEMATA.CATALOG_NAME, Schemata.SCHEMATA.SCHEMA_NAME }, true);
public static final ForeignKey<Record, Record> VIEWS__SYNTHETIC_FK_VIEWS__SYNTHETIC_PK_TABLES = Internal.createForeignKey(Views.VIEWS, DSL.name("SYNTHETIC_FK_views__SYNTHETIC_PK_tables"), new TableField[] { Views.VIEWS.TABLE_CATALOG, Views.VIEWS.TABLE_SCHEMA, Views.VIEWS.TABLE_NAME }, Keys.SYNTHETIC_PK_TABLES, new TableField[] { Tables.TABLES.TABLE_CATALOG, Tables.TABLES.TABLE_SCHEMA, Tables.TABLES.TABLE_NAME }, true);
}

View File

@ -15,7 +15,6 @@ import org.jooq.meta.postgres.information_schema.tables.ReferentialConstraints;
import org.jooq.meta.postgres.information_schema.tables.Routines;
import org.jooq.meta.postgres.information_schema.tables.Schemata;
import org.jooq.meta.postgres.information_schema.tables.Sequences;
import org.jooq.meta.postgres.information_schema.tables.TableConstraints;
import org.jooq.meta.postgres.information_schema.tables.Views;
@ -80,11 +79,6 @@ public class Tables {
*/
public static final Sequences SEQUENCES = Sequences.SEQUENCES;
/**
* The table <code>information_schema.table_constraints</code>.
*/
public static final TableConstraints TABLE_CONSTRAINTS = TableConstraints.TABLE_CONSTRAINTS;
/**
* The table <code>information_schema.tables</code>.
*/

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.information_schema.InformationSchema;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Attributes extends TableImpl<Record> {
private static final long serialVersionUID = -1746890016;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.attributes</code>

View File

@ -15,6 +15,7 @@ import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
@ -28,7 +29,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CheckConstraints extends TableImpl<Record> {
private static final long serialVersionUID = -1318152086;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.check_constraints</code>
@ -102,12 +103,13 @@ public class CheckConstraints extends TableImpl<Record> {
}
@Override
public List<ForeignKey<Record, ?>> getReferences() {
return Arrays.<ForeignKey<Record, ?>>asList(Keys.CHECK_CONSTRAINTS__SYNTHETIC_FK_CHECK_CONSTRAINTS__SYNTHETIC_PK_TABLE_CONSTRAINTS);
public UniqueKey<Record> getPrimaryKey() {
return Keys.SYNTHETIC_PK_CHECK_CONSTRAINTS;
}
public TableConstraints tableConstraints() {
return new TableConstraints(this, Keys.CHECK_CONSTRAINTS__SYNTHETIC_FK_CHECK_CONSTRAINTS__SYNTHETIC_PK_TABLE_CONSTRAINTS);
@Override
public List<UniqueKey<Record>> getKeys() {
return Arrays.<UniqueKey<Record>>asList(Keys.SYNTHETIC_PK_CHECK_CONSTRAINTS);
}
@Override

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.information_schema.InformationSchema;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Columns extends TableImpl<Record> {
private static final long serialVersionUID = -1114060488;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.columns</code>

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.information_schema.InformationSchema;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ConstraintColumnUsage extends TableImpl<Record> {
private static final long serialVersionUID = -1916631194;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.constraint_column_usage</code>

View File

@ -4,6 +4,9 @@
package org.jooq.meta.postgres.information_schema.tables;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
@ -12,10 +15,12 @@ import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.postgres.information_schema.InformationSchema;
import org.jooq.meta.postgres.information_schema.Keys;
/**
@ -24,7 +29,7 @@ import org.jooq.meta.postgres.information_schema.InformationSchema;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Domains extends TableImpl<Record> {
private static final long serialVersionUID = -990199018;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.domains</code>
@ -212,6 +217,16 @@ public class Domains extends TableImpl<Record> {
return InformationSchema.INFORMATION_SCHEMA;
}
@Override
public UniqueKey<Record> getPrimaryKey() {
return Keys.SYNTHETIC_PK_DOMAINS;
}
@Override
public List<UniqueKey<Record>> getKeys() {
return Arrays.<UniqueKey<Record>>asList(Keys.SYNTHETIC_PK_DOMAINS);
}
@Override
public Domains as(String alias) {
return new Domains(DSL.name(alias), this);

View File

@ -4,9 +4,6 @@
package org.jooq.meta.postgres.information_schema.tables;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
@ -19,7 +16,6 @@ import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.postgres.information_schema.InformationSchema;
import org.jooq.meta.postgres.information_schema.Keys;
/**
@ -28,7 +24,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class KeyColumnUsage extends TableImpl<Record> {
private static final long serialVersionUID = 96890073;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.key_column_usage</code>
@ -126,15 +122,6 @@ public class KeyColumnUsage extends TableImpl<Record> {
return InformationSchema.INFORMATION_SCHEMA;
}
@Override
public List<ForeignKey<Record, ?>> getReferences() {
return Arrays.<ForeignKey<Record, ?>>asList(Keys.KEY_COLUMN_USAGE__SYNTHETIC_FK_KEY_COLUMN_USAGE__SYNTHETIC_PK_TABLE_CONSTRAINTS);
}
public TableConstraints tableConstraints() {
return new TableConstraints(this, Keys.KEY_COLUMN_USAGE__SYNTHETIC_FK_KEY_COLUMN_USAGE__SYNTHETIC_PK_TABLE_CONSTRAINTS);
}
@Override
public KeyColumnUsage as(String alias) {
return new KeyColumnUsage(DSL.name(alias), this);

View File

@ -4,9 +4,6 @@
package org.jooq.meta.postgres.information_schema.tables;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
@ -19,7 +16,6 @@ import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.postgres.information_schema.InformationSchema;
import org.jooq.meta.postgres.information_schema.Keys;
/**
@ -28,7 +24,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Parameters extends TableImpl<Record> {
private static final long serialVersionUID = -208102988;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.parameters</code>
@ -241,15 +237,6 @@ public class Parameters extends TableImpl<Record> {
return InformationSchema.INFORMATION_SCHEMA;
}
@Override
public List<ForeignKey<Record, ?>> getReferences() {
return Arrays.<ForeignKey<Record, ?>>asList(Keys.PARAMETERS__SYNTHETIC_FK_PARAMETERS__SYNTHETIC_PK_ROUTINES);
}
public Routines routines() {
return new Routines(this, Keys.PARAMETERS__SYNTHETIC_FK_PARAMETERS__SYNTHETIC_PK_ROUTINES);
}
@Override
public Parameters as(String alias) {
return new Parameters(DSL.name(alias), this);

View File

@ -4,9 +4,6 @@
package org.jooq.meta.postgres.information_schema.tables;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
@ -19,7 +16,6 @@ import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.postgres.information_schema.InformationSchema;
import org.jooq.meta.postgres.information_schema.Keys;
/**
@ -28,7 +24,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ReferentialConstraints extends TableImpl<Record> {
private static final long serialVersionUID = 2065806373;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.referential_constraints</code>
@ -126,19 +122,6 @@ public class ReferentialConstraints extends TableImpl<Record> {
return InformationSchema.INFORMATION_SCHEMA;
}
@Override
public List<ForeignKey<Record, ?>> getReferences() {
return Arrays.<ForeignKey<Record, ?>>asList(Keys.REFERENTIAL_CONSTRAINTS__REFERENCING_CONSTRAINT, Keys.REFERENTIAL_CONSTRAINTS__REFERENCED_CONSTRAINT);
}
public TableConstraints referencingConstraint() {
return new TableConstraints(this, Keys.REFERENTIAL_CONSTRAINTS__REFERENCING_CONSTRAINT);
}
public TableConstraints referencedConstraint() {
return new TableConstraints(this, Keys.REFERENTIAL_CONSTRAINTS__REFERENCED_CONSTRAINT);
}
@Override
public ReferentialConstraints as(String alias) {
return new ReferentialConstraints(DSL.name(alias), this);

View File

@ -5,8 +5,6 @@ package org.jooq.meta.postgres.information_schema.tables;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
@ -16,12 +14,10 @@ import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.postgres.information_schema.InformationSchema;
import org.jooq.meta.postgres.information_schema.Keys;
/**
@ -30,7 +26,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Routines extends TableImpl<Record> {
private static final long serialVersionUID = -1881319768;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.routines</code>
@ -493,16 +489,6 @@ public class Routines extends TableImpl<Record> {
return InformationSchema.INFORMATION_SCHEMA;
}
@Override
public UniqueKey<Record> getPrimaryKey() {
return Keys.SYNTHETIC_PK_ROUTINES;
}
@Override
public List<UniqueKey<Record>> getKeys() {
return Arrays.<UniqueKey<Record>>asList(Keys.SYNTHETIC_PK_ROUTINES);
}
@Override
public Routines as(String alias) {
return new Routines(DSL.name(alias), this);

View File

@ -29,7 +29,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Schemata extends TableImpl<Record> {
private static final long serialVersionUID = -1387781475;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.schemata</code>

View File

@ -29,7 +29,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Sequences extends TableImpl<Record> {
private static final long serialVersionUID = -132910416;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.sequences</code>

View File

@ -1,170 +0,0 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.meta.postgres.information_schema.tables;
import java.util.Arrays;
import java.util.List;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
import org.jooq.meta.postgres.information_schema.InformationSchema;
import org.jooq.meta.postgres.information_schema.Keys;
/**
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TableConstraints extends TableImpl<Record> {
private static final long serialVersionUID = -1640574570;
/**
* The reference instance of <code>information_schema.table_constraints</code>
*/
public static final TableConstraints TABLE_CONSTRAINTS = new TableConstraints();
/**
* The class holding records for this type
*/
@Override
public Class<Record> getRecordType() {
return Record.class;
}
/**
* The column <code>information_schema.table_constraints.constraint_catalog</code>.
*/
public final TableField<Record, String> CONSTRAINT_CATALOG = createField(DSL.name("constraint_catalog"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.constraint_schema</code>.
*/
public final TableField<Record, String> CONSTRAINT_SCHEMA = createField(DSL.name("constraint_schema"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.constraint_name</code>.
*/
public final TableField<Record, String> CONSTRAINT_NAME = createField(DSL.name("constraint_name"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.table_catalog</code>.
*/
public final TableField<Record, String> TABLE_CATALOG = createField(DSL.name("table_catalog"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.table_schema</code>.
*/
public final TableField<Record, String> TABLE_SCHEMA = createField(DSL.name("table_schema"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.table_name</code>.
*/
public final TableField<Record, String> TABLE_NAME = createField(DSL.name("table_name"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.constraint_type</code>.
*/
public final TableField<Record, String> CONSTRAINT_TYPE = createField(DSL.name("constraint_type"), SQLDataType.VARCHAR, this, "");
/**
* The column <code>information_schema.table_constraints.is_deferrable</code>.
*/
public final TableField<Record, String> IS_DEFERRABLE = createField(DSL.name("is_deferrable"), SQLDataType.VARCHAR(3), this, "");
/**
* The column <code>information_schema.table_constraints.initially_deferred</code>.
*/
public final TableField<Record, String> INITIALLY_DEFERRED = createField(DSL.name("initially_deferred"), SQLDataType.VARCHAR(3), this, "");
/**
* The column <code>information_schema.table_constraints.enforced</code>.
*/
public final TableField<Record, String> ENFORCED = createField(DSL.name("enforced"), SQLDataType.VARCHAR(3), this, "");
private TableConstraints(Name alias, Table<Record> aliased) {
this(alias, aliased, null);
}
private TableConstraints(Name alias, Table<Record> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view());
}
/**
* Create an aliased <code>information_schema.table_constraints</code> table reference
*/
public TableConstraints(String alias) {
this(DSL.name(alias), TABLE_CONSTRAINTS);
}
/**
* Create an aliased <code>information_schema.table_constraints</code> table reference
*/
public TableConstraints(Name alias) {
this(alias, TABLE_CONSTRAINTS);
}
/**
* Create a <code>information_schema.table_constraints</code> table reference
*/
public TableConstraints() {
this(DSL.name("table_constraints"), null);
}
public <O extends Record> TableConstraints(Table<O> child, ForeignKey<O, Record> key) {
super(child, key, TABLE_CONSTRAINTS);
}
@Override
public Schema getSchema() {
return InformationSchema.INFORMATION_SCHEMA;
}
@Override
public UniqueKey<Record> getPrimaryKey() {
return Keys.SYNTHETIC_PK_TABLE_CONSTRAINTS;
}
@Override
public List<UniqueKey<Record>> getKeys() {
return Arrays.<UniqueKey<Record>>asList(Keys.SYNTHETIC_PK_TABLE_CONSTRAINTS);
}
@Override
public TableConstraints as(String alias) {
return new TableConstraints(DSL.name(alias), this);
}
@Override
public TableConstraints as(Name alias) {
return new TableConstraints(alias, this);
}
/**
* Rename this table
*/
@Override
public TableConstraints rename(String name) {
return new TableConstraints(DSL.name(name), null);
}
/**
* Rename this table
*/
@Override
public TableConstraints rename(Name name) {
return new TableConstraints(name, null);
}
}

View File

@ -29,7 +29,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Tables extends TableImpl<Record> {
private static final long serialVersionUID = 1135725221;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.tables</code>

View File

@ -28,7 +28,7 @@ import org.jooq.meta.postgres.information_schema.Keys;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Views extends TableImpl<Record> {
private static final long serialVersionUID = 937684986;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>information_schema.views</code>

View File

@ -17,7 +17,7 @@ import org.jooq.impl.CatalogImpl;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DefaultCatalog extends CatalogImpl {
private static final long serialVersionUID = 2096040957;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>DEFAULT_CATALOG</code>

View File

@ -38,8 +38,9 @@ public class Keys {
// -------------------------------------------------------------------------
public static final ForeignKey<Record, Record> PG_CLASS__SYNTHETIC_FK_PG_CLASS__SYNTHETIC_PK_PG_NAMESPACE = Internal.createForeignKey(PgClass.PG_CLASS, DSL.name("SYNTHETIC_FK_pg_class__SYNTHETIC_PK_pg_namespace"), new TableField[] { PgClass.PG_CLASS.RELNAMESPACE }, Keys.SYNTHETIC_PK_PG_NAMESPACE, new TableField[] { PgNamespace.PG_NAMESPACE.OID }, true);
public static final ForeignKey<Record, Record> PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_CLASS = Internal.createForeignKey(PgConstraint.PG_CONSTRAINT, DSL.name("SYNTHETIC_FK_pg_constraint__SYNTHETIC_PK_pg_class"), new TableField[] { PgConstraint.PG_CONSTRAINT.CONRELID }, Keys.SYNTHETIC_PK_PG_CLASS, new TableField[] { PgClass.PG_CLASS.OID }, true);
public static final ForeignKey<Record, Record> PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_NAMESPACE = Internal.createForeignKey(PgConstraint.PG_CONSTRAINT, DSL.name("SYNTHETIC_FK_pg_constraint__SYNTHETIC_PK_pg_namespace"), new TableField[] { PgConstraint.PG_CONSTRAINT.CONNAMESPACE }, Keys.SYNTHETIC_PK_PG_NAMESPACE, new TableField[] { PgNamespace.PG_NAMESPACE.OID }, true);
public static final ForeignKey<Record, Record> PG_ENUM__REFERENCING_CONSTRAINT = Internal.createForeignKey(PgEnum.PG_ENUM, DSL.name("REFERENCING_CONSTRAINT"), new TableField[] { PgEnum.PG_ENUM.ENUMTYPID }, Keys.SYNTHETIC_PK_PG_TYPE, new TableField[] { PgType.PG_TYPE.OID }, true);
public static final ForeignKey<Record, Record> PG_ENUM__SYNTHETIC_FK_PG_ENUM__SYNTHETIC_PK_PG_TYPE = Internal.createForeignKey(PgEnum.PG_ENUM, DSL.name("SYNTHETIC_FK_pg_enum__SYNTHETIC_PK_pg_type"), new TableField[] { PgEnum.PG_ENUM.ENUMTYPID }, Keys.SYNTHETIC_PK_PG_TYPE, new TableField[] { PgType.PG_TYPE.OID }, true);
public static final ForeignKey<Record, Record> PG_INDEX__INDEX_CLASS = Internal.createForeignKey(PgIndex.PG_INDEX, DSL.name("INDEX_CLASS"), new TableField[] { PgIndex.PG_INDEX.INDEXRELID }, Keys.SYNTHETIC_PK_PG_CLASS, new TableField[] { PgClass.PG_CLASS.OID }, true);
public static final ForeignKey<Record, Record> PG_INDEX__TABLE_CLASS = Internal.createForeignKey(PgIndex.PG_INDEX, DSL.name("TABLE_CLASS"), new TableField[] { PgIndex.PG_INDEX.INDRELID }, Keys.SYNTHETIC_PK_PG_CLASS, new TableField[] { PgClass.PG_CLASS.OID }, true);
public static final ForeignKey<Record, Record> PG_TYPE__SYNTHETIC_FK_PG_TYPE__SYNTHETIC_PK_PG_NAMESPACE = Internal.createForeignKey(PgType.PG_TYPE, DSL.name("SYNTHETIC_FK_pg_type__SYNTHETIC_PK_pg_namespace"), new TableField[] { PgType.PG_TYPE.TYPNAMESPACE }, Keys.SYNTHETIC_PK_PG_NAMESPACE, new TableField[] { PgNamespace.PG_NAMESPACE.OID }, true);

View File

@ -31,7 +31,7 @@ import org.jooq.meta.postgres.pg_catalog.tables.PgType;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgCatalog extends SchemaImpl {
private static final long serialVersionUID = 1085930158;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog</code>

View File

@ -18,7 +18,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Count1 extends AbstractRoutine<Long> {
private static final long serialVersionUID = 1466800425;
private static final long serialVersionUID = 1L;
/**
* The parameter <code>pg_catalog.count.RETURN_VALUE</code>.

View File

@ -17,7 +17,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Count2 extends AbstractRoutine<Long> {
private static final long serialVersionUID = -693114807;
private static final long serialVersionUID = 1L;
/**
* The parameter <code>pg_catalog.count.RETURN_VALUE</code>.

View File

@ -18,7 +18,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class FormatType extends AbstractRoutine<String> {
private static final long serialVersionUID = 1896410112;
private static final long serialVersionUID = 1L;
/**
* The parameter <code>pg_catalog.format_type.RETURN_VALUE</code>.

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgAttrdef extends TableImpl<Record> {
private static final long serialVersionUID = 430142938;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_attrdef</code>

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgAttribute extends TableImpl<Record> {
private static final long serialVersionUID = 672275510;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_attribute</code>

View File

@ -29,7 +29,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgClass extends TableImpl<Record> {
private static final long serialVersionUID = -218505687;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_class</code>

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgCollation extends TableImpl<Record> {
private static final long serialVersionUID = -1853827620;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_collation</code>

View File

@ -28,7 +28,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgConstraint extends TableImpl<Record> {
private static final long serialVersionUID = 404160814;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_constraint</code>
@ -209,13 +209,17 @@ public class PgConstraint extends TableImpl<Record> {
@Override
public List<ForeignKey<Record, ?>> getReferences() {
return Arrays.<ForeignKey<Record, ?>>asList(Keys.PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_NAMESPACE);
return Arrays.<ForeignKey<Record, ?>>asList(Keys.PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_NAMESPACE, Keys.PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_CLASS);
}
public PgNamespace pgNamespace() {
return new PgNamespace(this, Keys.PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_NAMESPACE);
}
public PgClass pgClass() {
return new PgClass(this, Keys.PG_CONSTRAINT__SYNTHETIC_FK_PG_CONSTRAINT__SYNTHETIC_PK_PG_CLASS);
}
@Override
public PgConstraint as(String alias) {
return new PgConstraint(DSL.name(alias), this);

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgDescription extends TableImpl<Record> {
private static final long serialVersionUID = -1984292078;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_description</code>

View File

@ -28,7 +28,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgEnum extends TableImpl<Record> {
private static final long serialVersionUID = -1870532870;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_enum</code>
@ -103,11 +103,11 @@ public class PgEnum extends TableImpl<Record> {
@Override
public List<ForeignKey<Record, ?>> getReferences() {
return Arrays.<ForeignKey<Record, ?>>asList(Keys.PG_ENUM__REFERENCING_CONSTRAINT);
return Arrays.<ForeignKey<Record, ?>>asList(Keys.PG_ENUM__SYNTHETIC_FK_PG_ENUM__SYNTHETIC_PK_PG_TYPE);
}
public PgType pgType() {
return new PgType(this, Keys.PG_ENUM__REFERENCING_CONSTRAINT);
return new PgType(this, Keys.PG_ENUM__SYNTHETIC_FK_PG_ENUM__SYNTHETIC_PK_PG_TYPE);
}
@Override

View File

@ -28,7 +28,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgIndex extends TableImpl<Record> {
private static final long serialVersionUID = 1715995978;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_index</code>

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgInherits extends TableImpl<Record> {
private static final long serialVersionUID = 978457723;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_inherits</code>

View File

@ -29,7 +29,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgNamespace extends TableImpl<Record> {
private static final long serialVersionUID = -1114033554;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_namespace</code>

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgProc extends TableImpl<Record> {
private static final long serialVersionUID = -1945177977;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_proc</code>

View File

@ -24,7 +24,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgSequence extends TableImpl<Record> {
private static final long serialVersionUID = -1398651846;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_sequence</code>

View File

@ -29,7 +29,7 @@ import org.jooq.meta.postgres.pg_catalog.PgCatalog;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgType extends TableImpl<Record> {
private static final long serialVersionUID = -1116590481;
private static final long serialVersionUID = 1L;
/**
* The reference instance of <code>pg_catalog.pg_type</code>

View File

@ -18,7 +18,7 @@ final class MetaSQL {
M_UNIQUE_KEYS.put(HSQLDB, "select INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_CATALOG, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.ORDINAL_POSITION from (INFORMATION_SCHEMA.KEY_COLUMN_USAGE left outer join INFORMATION_SCHEMA.TABLE_CONSTRAINTS as alias_10316587 on (INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_CATALOG = alias_10316587.CONSTRAINT_CATALOG and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA = alias_10316587.CONSTRAINT_SCHEMA and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME = alias_10316587.CONSTRAINT_NAME)) where (alias_10316587.CONSTRAINT_TYPE = 'UNIQUE' and alias_10316587.TABLE_SCHEMA in (cast(? as varchar(128)))) order by INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.ORDINAL_POSITION asc");
M_UNIQUE_KEYS.put(MARIADB, "select distinct null as TABLE_CATALOG, information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.COLUMN_NAME, information_schema.STATISTICS.SEQ_IN_INDEX from information_schema.STATISTICS where (information_schema.STATISTICS.TABLE_SCHEMA in (?, 'ee7f6174-34f2-484b-8d81-20a4d9fc866d') and information_schema.STATISTICS.INDEX_NAME <> 'PRIMARY' and information_schema.STATISTICS.NON_UNIQUE = 0) order by information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.SEQ_IN_INDEX");
M_UNIQUE_KEYS.put(MYSQL, "select distinct null as TABLE_CATALOG, information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.COLUMN_NAME, information_schema.STATISTICS.SEQ_IN_INDEX from information_schema.STATISTICS where (information_schema.STATISTICS.TABLE_SCHEMA in (?, 'ee7f6174-34f2-484b-8d81-20a4d9fc866d') and information_schema.STATISTICS.INDEX_NAME <> 'PRIMARY' and information_schema.STATISTICS.NON_UNIQUE = 0) order by information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.SEQ_IN_INDEX");
M_UNIQUE_KEYS.put(POSTGRES, "select information_schema.key_column_usage.table_catalog, information_schema.key_column_usage.table_schema, information_schema.key_column_usage.table_name, information_schema.key_column_usage.constraint_name, information_schema.key_column_usage.column_name, information_schema.key_column_usage.ordinal_position from (information_schema.key_column_usage left outer join information_schema.table_constraints as alias_99043051 on (information_schema.key_column_usage.constraint_catalog = alias_99043051.constraint_catalog and information_schema.key_column_usage.constraint_schema = alias_99043051.constraint_schema and information_schema.key_column_usage.constraint_name = alias_99043051.constraint_name)) where (alias_99043051.constraint_type = 'UNIQUE' and alias_99043051.table_schema in (?)) order by information_schema.key_column_usage.table_schema asc, information_schema.key_column_usage.table_name asc, information_schema.key_column_usage.constraint_name asc, information_schema.key_column_usage.ordinal_position asc");
M_UNIQUE_KEYS.put(POSTGRES, "select k.table_catalog, k.table_schema, k.table_name, k.constraint_name, k.column_name, k.ordinal_position from (pg_catalog.pg_constraint as c join (pg_catalog.pg_class as alias_89552482 join pg_catalog.pg_namespace as alias_126892781 on alias_89552482.relnamespace = alias_126892781.oid) on c.conrelid = alias_89552482.oid join pg_catalog.pg_namespace as alias_87501535 on c.connamespace = alias_87501535.oid) join information_schema.key_column_usage as k on (k.table_schema = alias_126892781.nspname and k.table_name = alias_89552482.relname and k.constraint_schema = alias_87501535.nspname and k.constraint_name = c.conname) where (c.contype = 'u' and alias_87501535.nspname in (?)) order by k.table_schema asc, k.table_name asc, k.constraint_name asc, k.ordinal_position asc");