(Quick Reference)

3 Configuration - Reference Documentation

Authors: Burt Beckwith

Version: 4.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).

PropertyDefaultMeaning
grails.plugin.reveng.packageNameapplication namepackage name for the generated domain classes
grails.plugin.reveng.manyToManyBelongsTosnonea 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.

PropertyDefaultMeaning
grails.plugin.reveng.includeTablesnonea List of table names to include for processing
grails.plugin.reveng.includeTableRegexesnonea List of table name regex patterns to include for processing
grails.plugin.reveng.includeTableAntPatternsnonea List of table name Ant-style patterns to include for processing
grails.plugin.reveng.excludeTablesnonea List of table names to exclude from processing
grails.plugin.reveng.excludeTableRegexesnonea List of table name regex patterns to exclude from processing
grails.plugin.reveng.excludeTableAntPatternsnonea List of table name Ant-style patterns to exclude from processing
grails.plugin.reveng.excludeColumnsnonea Map of table name -> List of column names to ignore
grails.plugin.reveng.excludeColumnRegexesnonea Map of table name -> List of column name regex patterns to ignore
grails.plugin.reveng.excludeColumnAntPatternsnonea Map of table name -> List of column name Ant-style patterns to ignore
grails.plugin.reveng.manyToManyTablesnonea 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.

PropertyDefaultMeaning
grails.plugin.reveng.destDir'grails-app/domain'destination folder for the generated classes, relative to the project root
grails.plugin.reveng.versionColumnsnonea Map of table name -> version column name, for tables with an optimistic locking column that's not named 'version'
grails.plugin.reveng.overwriteExistingtruewhether to overwrite existing domain classes
grails.plugin.reveng.defaultSchemanonethe default database schema name
grails.plugin.reveng.defaultCatalognonethe default database catalog name