grails install-plugin http://grails400utils.googlecode.com/files/grails-systemitools-1.0.zip
The IBM System i has a wealth of legacy applications that contain data files many of which were designed several decades ago. There are typically several issues with these files:
- They often have cryptic field names that are limited to 4 significant digits
- They often have assigned keys
- Keys are often composite
- They rarely have a version number or timestamp
- Character fields are most always statically sized (no varchar)
- The id is generated
- The presence of an zero id or version number is used to predicate an SQL insert
- Hibernate insert/updates to character columns with strings that exceed the column's maximum length generates an exception
- It will attempt to create domain attribute names from column heading or column text, and, if that fails, the original field name is used
- It will generate Grails constraints for maximum integer, big decimal, and character attributes that match the table definition.
- It will generate the GORM DSL appropriate for the assigned key (composite or atomic)
- It will copy over to the Grails project scaffolding that uses the appropriate mechanism to get() or save() the domain. Note that this plugin requires Grails 1.1 and uses the save(insert:true) to predicate insert versus update.
- The custom scaffolding includes view templates that insert the appropriate links (from a custom tag library)