Led & Sustained by

G2one Logo

Developed with

Intellij

Powered by

Spring

Systemi Grails Domain Plugin

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)

These issues cause complexity with Grails because Grails makes the following assumptions:

  • 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

This plugin will generate a Grails domain class from a legacy System i table. It has the following features:

  • 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 required Grails 1.0.2 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)

Use the following Grails command to install the plugin:

grails install-plugin http://grails400utils.googlecode.com/files/grails-systemitools-0.2.zip

Detailed notes for installation and use of this plugin are at: http://code.google.com/p/grails400utils/wiki/GrailsProjectPlugin

</