There are several use cases, when the run-time schema configuration may be
different from the compile-time (or code-generation-time) schema
configuration. Say, you develop a schema called DEV. It contains
a table DEV.T. When you install your database on a productive
system, you might have two schemata:
PROD: The productive schema. It contains the table
PROD.TBACKUP: The productive backup schema. This schema might be
shared with other applications, so you might have table name collisions.
Therefore, you'd want to map your table DEV.T onto
BACKUP.MY_T
This can be achieved with the SchemaMapping, where you can map
schemata and tables, for them to render different names at run-time, than at
compile-time.
| Modifier and Type | Field and Description |
|---|---|
| private transient volatile Map | |
| private final Configuration | |
| private static final JooqLogger | |
| private static volatile boolean | |
| private transient volatile Map | |
| private transient volatile Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private final Map | |
| private final Map | |
| private final Map | |
| private static void | |
| public @Nullable Catalog | |
| public @Nullable Schema | |
| public <R extends Record> @Nullable Table | |
| private final RenderMapping | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| public void | |
| public void | |
| public String | |
| public void | |
| public void |
| catalogs | back to summary |
|---|---|
| private transient volatile Map<String, Catalog> catalogs | |
| configuration | back to summary |
|---|---|
| private final Configuration configuration | |
| log | back to summary |
|---|---|
| private static final JooqLogger log | |
| loggedDeprecation | back to summary |
|---|---|
| private static volatile boolean loggedDeprecation | |
| schemata | back to summary |
|---|---|
| private transient volatile Map<String, Schema> schemata | |
| tables | back to summary |
|---|---|
| private transient volatile Map<String, Table<?>> tables | |
| SchemaMapping | back to summary |
|---|---|
| public SchemaMapping(Configuration configuration) Construct a mapping from a | |
| add | back to summary |
|---|---|
| public void add(String inputSchema, String outputSchema) Add schemata to this mapping | |
| add | back to summary |
|---|---|
| public void add(String inputSchema, Schema outputSchema) Add schemata to this mapping | |
| add | back to summary |
|---|---|
| public void add(Schema inputSchema, Schema outputSchema) Add schemata to this mapping | |
| add | back to summary |
|---|---|
| public void add(Schema inputSchema, String outputSchema) Add schemata to this mapping | |
| add | back to summary |
|---|---|
| public void add(Table<?> inputTable, Table<?> outputTable) Add tables to this mapping | |
| add | back to summary |
|---|---|
| public void add(final Table<?> inputTable, final String outputTable) Add tables to this mapping | |
| getCatalogs | back to summary |
|---|---|
| private final Map | |
| getSchemata | back to summary |
|---|---|
| private final Map | |
| getTables | back to summary |
|---|---|
| private final Map | |
| logDeprecation | back to summary |
|---|---|
| private static void logDeprecation() | |
| map | back to summary |
|---|---|
public @Nullable Catalog map(Catalog catalog)
| |
| map | back to summary |
|---|---|
| public @Nullable Schema map(Schema schema) Apply mapping to a given schema | |
| map | back to summary |
|---|---|
| public <R extends Record> @Nullable Table Apply mapping to a given table
| |
| mapping | back to summary |
|---|---|
| private final RenderMapping mapping() | |
| matches | back to summary |
|---|---|
| private final boolean matches(MappedCatalog c, String catalogName) | |
| matches | back to summary |
|---|---|
| private final boolean matches(MappedSchema s, String schemaName) | |
| matches | back to summary |
|---|---|
| private final boolean matches(MappedTable t, String tableName) | |
| renderCatalog | back to summary |
|---|---|
| private final boolean renderCatalog() | |
| renderSchema | back to summary |
|---|---|
| private final boolean renderSchema() | |
| setDefaultSchema | back to summary |
|---|---|
| public void setDefaultSchema(String schema) Synonym for | |
| setSchemaMapping | back to summary |
|---|---|
| public void setSchemaMapping(Map<String, String> schemaMap) Initialise SchemaMapping. Added for better interoperability with Spring | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| use | back to summary |
|---|---|
| public void use(Schema schema) Set a schema as the default schema. This results in the supplied schema being omitted in generated SQL.
If the supplied mapping has already been added using
| |
| use | back to summary |
|---|---|
| public void use(String schemaName) Set a schema as the default schema. This results in the supplied schema being omitted in generated SQL.
If the supplied mapping has already been added using
| |