[jOOQ/jOOQ#11248] Implement MetaTable::getTriggers
This commit is contained in:
parent
238d497631
commit
57ed425370
@ -676,6 +676,8 @@ public class HSQLDBDatabase extends AbstractDatabase implements ResultQueryDatab
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -682,6 +682,8 @@ public class MySQLDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -984,6 +984,8 @@ public class PostgresDatabase extends AbstractDatabase implements ResultQueryDat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -91,6 +91,7 @@ import java.sql.DatabaseMetaData;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -124,6 +125,10 @@ import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.TableOptions;
|
||||
import org.jooq.TableOptions.TableType;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.conf.ParseUnknownFunctions;
|
||||
import org.jooq.exception.DataAccessException;
|
||||
@ -391,6 +396,9 @@ final class MetaImpl extends AbstractMeta {
|
||||
private transient volatile Map<Name, String> sourceCache;
|
||||
private transient volatile Map<Name, String> commentCache;
|
||||
|
||||
|
||||
|
||||
|
||||
MetaSchema(String name, Catalog catalog) {
|
||||
super(name, catalog);
|
||||
}
|
||||
@ -493,6 +501,9 @@ final class MetaImpl extends AbstractMeta {
|
||||
this,
|
||||
getColumns(catalog, schema, name),
|
||||
getUks(catalog, schema, name),
|
||||
|
||||
|
||||
|
||||
remarks,
|
||||
tableType
|
||||
);
|
||||
@ -599,6 +610,52 @@ final class MetaImpl extends AbstractMeta {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private final Result<Record> getColumns(String catalog, String schema, String table) {
|
||||
|
||||
@ -840,7 +897,21 @@ final class MetaImpl extends AbstractMeta {
|
||||
private final MetaSchema schema;
|
||||
private final Result<Record> uks;
|
||||
|
||||
MetaTable(String name, MetaSchema schema, Result<Record> columns, Result<Record> uks, String remarks, TableType tableType) {
|
||||
|
||||
|
||||
|
||||
|
||||
MetaTable(
|
||||
String name,
|
||||
MetaSchema schema,
|
||||
Result<Record> columns,
|
||||
Result<Record> uks,
|
||||
|
||||
|
||||
|
||||
String remarks,
|
||||
TableType tableType
|
||||
) {
|
||||
super(
|
||||
name(name),
|
||||
schema,
|
||||
@ -853,6 +924,9 @@ final class MetaImpl extends AbstractMeta {
|
||||
this.schema = schema;
|
||||
this.uks = uks;
|
||||
|
||||
|
||||
|
||||
|
||||
// Possible scenarios for columns being null:
|
||||
// - The "table" is in fact a SYNONYM
|
||||
if (columns != null)
|
||||
@ -1102,6 +1176,46 @@ final class MetaImpl extends AbstractMeta {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,94 +1,9 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.DERBY;
|
||||
import static org.jooq.SQLDialect.DUCKDB;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.FIREBIRD;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.H2;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.HSQLDB;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MARIADB;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.TRINO;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.YUGABYTEDB;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
// ...
|
||||
import org.jooq.SQLDialect;
|
||||
|
||||
// The queries generated by MetaGeneration from the various jOOQ-meta ResultQueryDatabase types.
|
||||
@ -99,10 +14,7 @@ final class MetaSQL {
|
||||
private static final EnumMap<SQLDialect, String> M_ENUMS = new EnumMap<>(SQLDialect.class);
|
||||
private static final EnumMap<SQLDialect, String> M_SOURCES = new EnumMap<>(SQLDialect.class);
|
||||
private static final EnumMap<SQLDialect, String> M_COMMENTS = new EnumMap<>(SQLDialect.class);
|
||||
|
||||
|
||||
|
||||
|
||||
private static final EnumMap<SQLDialect, String> M_TRIGGERS = new EnumMap<>(SQLDialect.class);
|
||||
|
||||
static final String M_UNIQUE_KEYS(SQLDialect dialect) {
|
||||
String result = M_UNIQUE_KEYS.get(dialect);
|
||||
@ -134,15 +46,10 @@ final class MetaSQL {
|
||||
return result != null ? result : M_COMMENTS.get(dialect.family());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static final String M_TRIGGERS(SQLDialect dialect) {
|
||||
String result = M_TRIGGERS.get(dialect);
|
||||
return result != null ? result : M_TRIGGERS.get(dialect.family());
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user