Generating Custom EO Java Classes

Last modified by David Avendasora on 2011/05/25 12:58

WOLips has the ability to generate .java files for the Entities in your project's EOModel files. In Project Builder and Xcode, and really old versions of WOLips, you had to do this yourself by using Rubicode's EOGenerator. WOLips now has it's own built-in EOGenerator. It has a different templating engine (Velocity instead of MiscMerge)

Create and Configure an .eogen file for your EOModel

  1. Right-click on your EOModel in WOLips and select WOLips Tools=>Create EOGenerator File.
    eogenIcon.jpg
  2. Double click on the <ModelName>.eogen icon in the Package Explorer or Navigator:
    EOGenerator1.jpg
  3. In the "Models" section, add the EOModel(s) that have Entities that you want to generate Java classes for.
  4. In the "Referenced Models" section, include any other EOModels that contain Prototypes or Entities that are used or referenced by the EOModels in the "Models" section.
Warning

Java classes will not be generated for Entities in the EOModels in the "Referenced Models" section.

The File Names settings can be ignored unless you need to generate oddly formed file names. You will usually want to Create Packages (place the generated files in a directory corresponding to their package). It can useful to have different Destination and Subclass Destination directories. The totally generated classes in the Destination directory are not very interesting and can be tucked away out of sight.

EOGenerator2.jpg

The Templates determine how the Java code is generated. The setting should be self explanatory. The Defines are useful for extending the templates with custom values.

EOGenerator3.jpg

Generate the Classes

The Simplest Way is Set it on Automatic

Use the WOLips build preferences to ensure your classes are regenerated every time you save changes to the EOModel

Picture 16.jpg

Manual Generation during Development

To generate the Java classes manually, simply right (control) click on the .eogen configuration and select EOGenerate... from the context menu. A dialog window will be shown when EOGenerator finishes so that you can verify what it did.

Troubleshooting

Warning

EOGenerator Not Running?

Nothing happens? Just see a flicker of a progress bar at the bottom right? Go back to the Preferences. The path to the eogenerator executable is missing or incorrect.