(Quick Reference)
3 Configuration - Reference Documentation
Authors: Burt Beckwith
Version: 3.0.0
3 Configuration
There are several configuration options for the plugin.
Core properties
These configuration options are the one you're most likely need to set. They include the package name of the generated files (
grails.plugin.reveng.packageName
), and information about which side of a many-to-many is the 'belongsTo' side (
grails.plugin.reveng.manyToManyBelongsTos
).
Property | Default | Meaning |
---|
grails.plugin.reveng.packageName | application name | package name for the generated domain classes |
grails.plugin.reveng.manyToManyBelongsTos | none | a Map of join table name -> belongsTo table name to specify which of the two domain classes is the 'belongsTo' side of the relationship |
Inclusion/exclusion properties
These configuration options let you define which tables and columns to include in processing. By default all tables and columns are processed.
If you specify tables to include (
g.p.r.includeTables
,
g.p.r.includeTableRegexes
, and/or
g.p.r.includeTableAntPatterns
) then only those will be used. If you specify any of these options then all of the table exclusion options are ignored; this is useful when you have already run the reverse engineer script but want to re-run it for only a subset of tables.
If you specify tables to exclude (
g.p.r.excludeTables
,
g.p.r.excludeTableRegexes
, and/or
g.p.r.excludeTableAntPatterns
) then any matching tables will be ignored.
You can also specify columns to exclude (
g.p.r.excludeColumns
,
g.p.r.excludeColumnRegexes
, and/or
g.p.r.excludeColumnAntPatterns
) and any matching columns will be ignored. These options can be used with table include rules or table exclude rules - any tables that are included or not excluded will have their columns included or excludede based on these rules.
One addition property,
grails.plugin.reveng.manyToManyTables
, doesn't affect whether a table is processed, but rather determines whether a table that won't look like a many-to-many table to the Hibernate Tools library (because it has more than two columns) is considered a many-to-many table.
Property | Default | Meaning |
---|
grails.plugin.reveng.includeTables | none | a List of table names to include for processing |
grails.plugin.reveng.includeTableRegexes | none | a List of table name regex patterns to include for processing |
grails.plugin.reveng.includeTableAntPatterns | none | a List of table name Ant-style patterns to include for processing |
grails.plugin.reveng.excludeTables | none | a List of table names to exclude from processing |
grails.plugin.reveng.excludeTableRegexes | none | a List of table name regex patterns to exclude from processing |
grails.plugin.reveng.excludeTableAntPatterns | none | a List of table name Ant-style patterns to exclude from processing |
grails.plugin.reveng.excludeColumns | none | a Map of table name -> List of column names to ignore |
grails.plugin.reveng.excludeColumnRegexes | none | a Map of table name -> List of column name regex patterns to ignore |
grails.plugin.reveng.excludeColumnAntPatterns | none | a Map of table name -> List of column name Ant-style patterns to ignore |
grails.plugin.reveng.manyToManyTables | none | a List of table names that should be considered many-to-many join tables; needed for join tables that have more columns than the two foreign keys |
Other properties
These remaining configuration options allow you to specify the folder where the domain classes are generated (
g.p.r.destDir
), whether to overwrite existing classes (
g.p.r.overwriteExisting
) and non-standard 'version' column names (
g.p.r.versionColumns
).
There are also properties to set the default schema name (
g.p.r.defaultSchema
) and catalog (
g.p.r.defaultCatalog
) name which are useful when working with Oracle.
Property | Default | Meaning |
---|
grails.plugin.reveng.destDir | 'grails-app/domain' | destination folder for the generated classes, relative to the project root |
grails.plugin.reveng.versionColumns | none | a Map of table name -> version column name, for tables with an optimistic locking column that's not named 'version' |
grails.plugin.reveng.overwriteExisting | true | whether to overwrite existing domain classes |
grails.plugin.reveng.defaultSchema | none | the default database schema name |
grails.plugin.reveng.defaultCatalog | none | the default database catalog name |