Settings
instead@Deprecated
public class SchemaMapping
extends java.lang.Object
implements java.io.Serializable
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.T
BACKUP
: 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.
Constructor and Description |
---|
SchemaMapping(Configuration configuration)
Deprecated.
Construct a mapping from a
Configuration object |
Modifier and Type | Method and Description |
---|---|
void |
add(Schema inputSchema,
Schema outputSchema)
Deprecated.
Add schemata to this mapping
|
void |
add(Schema inputSchema,
java.lang.String outputSchema)
Deprecated.
Add schemata to this mapping
|
void |
add(java.lang.String inputSchema,
Schema outputSchema)
Deprecated.
Add schemata to this mapping
|
void |
add(java.lang.String inputSchema,
java.lang.String outputSchema)
Deprecated.
Add schemata to this mapping
|
void |
add(Table<?> inputTable,
java.lang.String outputTable)
Deprecated.
Add tables to this mapping
|
void |
add(Table<?> inputTable,
Table<?> outputTable)
Deprecated.
Add tables to this mapping
|
Schema |
map(Schema schema)
Deprecated.
Apply mapping to a given schema
|
<R extends Record> |
map(Table<R> table)
Deprecated.
Apply mapping to a given table
|
void |
setDefaultSchema(java.lang.String schema)
Deprecated.
Synonym for
use(String) . |
void |
setSchemaMapping(java.util.Map<java.lang.String,java.lang.String> schemaMap)
Deprecated.
Initialise SchemaMapping.
|
java.lang.String |
toString()
Deprecated.
|
void |
use(Schema schema)
Deprecated.
Set a schema as the default schema.
|
void |
use(java.lang.String schemaName)
Deprecated.
Set a schema as the default schema.
|
public SchemaMapping(Configuration configuration)
Configuration
objectpublic void use(Schema schema)
If the supplied mapping has already been added using
add(Schema, Schema)
, then use()
has no effect.
schema
- the default schemapublic void use(java.lang.String schemaName)
If the supplied mapping has already been added using
add(Schema, Schema)
, then use()
has no effect.
schemaName
- the default schemapublic void add(java.lang.String inputSchema, java.lang.String outputSchema)
inputSchema
- The schema known at codegen time to be mappedoutputSchema
- The schema configured at run time to be mappedpublic void add(java.lang.String inputSchema, Schema outputSchema)
inputSchema
- The schema known at codegen time to be mappedoutputSchema
- The schema configured at run time to be mappedpublic void add(Schema inputSchema, Schema outputSchema)
inputSchema
- The schema known at codegen time to be mappedoutputSchema
- The schema configured at run time to be mappedpublic void add(Schema inputSchema, java.lang.String outputSchema)
inputSchema
- The schema known at codegen time to be mappedoutputSchema
- The schema configured at run time to be mappedpublic void add(Table<?> inputTable, Table<?> outputTable)
inputTable
- The table known at codegen time to be mappedoutputTable
- The table configured at run time to be mappedpublic void add(Table<?> inputTable, java.lang.String outputTable)
inputTable
- The table known at codegen time to be mappedoutputTable
- The table configured at run time to be mappedpublic Schema map(Schema schema)
schema
- The schema to be mappedpublic <R extends Record> Table<R> map(Table<R> table)
table
- The generated table to be mappedpublic void setDefaultSchema(java.lang.String schema)
use(String)
. Added for better interoperability with
Springpublic void setSchemaMapping(java.util.Map<java.lang.String,java.lang.String> schemaMap)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2015. All Rights Reserved.