Details
Description
It would be useful to provide a generic mechanism to enable the user to pass global platform-specific hints to templates. For example, for MySQL it is desirable to explicitly specify the type of table to be created, e.g., CREATE TABLE foo (...) Type = InnoDB. Such global hints could then be specified by the user through platform specific properties or property files, as in:
platform.properties:
mysql.table.hint=Type = InnoDB.
A matching table.vm template might look something like:
- -----------------------------------------------------------------------
- $table.Name
- -----------------------------------------------------------------------
$generator.parse("$basepath/drop.vm", "", "table", $tbl)
CREATE TABLE $table.Name
(
etc...
) $platform.getProperty('mysql.table.hint');
Without such a capability it is necessary to hard-code the required customizations into the templates, which is a rather inflexible and inconvenient way of doing it.