@Documented
@Retention(RUNTIME)
@Target(TYPE)
@Analyze("org.tentackle.buildsupport.TableNameAnalyzeHandler")
public @interface TableName
Annotation for the tablename of a PDO.
The tablename can be modified by the options:
- mapSchema: if true, dots will be replaced by underscores
- prefix: prepends given string to each tablename
<wurbletProperties>
<tablePrefix>pls</tablePrefix>
...
and in the code:
@TableName(value=/**/"md.ingotcategory"/**/, // @wurblet < Inject --string $tablename
mapSchema=/**/false/**/, // @wurblet < Inject $mapSchema
prefix=/**/""/**/) // @wurblet < Inject --string $tablePrefix
Means: all schemas get "pls" prepended (for example: "td.message" becomes "plstd.message").
Non-schema tables from the TT-framework (technical tables) remain in the default schema.
This configuration is particularly useful for databases like Oracle that
emulate schemas via extra users. As a result, the main user "pls" remains unchanged,
transaction data goes to the "schema-user" plstd while the master data go to plsmd.
The model, however, remains unchanged! It's just a configuration in pom.xml.With mapSchema=true and prefix="" all tables go to the default schema, while master data tables start with md_ and transaction data with td_.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueDetermines the tablename.- Returns:
- the tablename
-
-
-
mapSchema
boolean mapSchemaDetermines whether schemas are allowed or mapped to simple table names.
If true, tablenames like "md.blah" are mapped to "md_blah". This is especially useful for databases that don't support schemas or provide only quirky workarounds (Oracle, MySQL, for example).- Returns:
- true if map to non-schema name
- Default:
- false
-
prefix
String prefixAdds a prefix to the tablename or schema.- Returns:
- the optional prefix
- Default:
- ""
-