10.8. Related Tools
Although it is often easiest to define the tables, beans, and mapping file at the same time, there are a number of tools available that will aid in the creation of some of these from the information contained in the others. Of particular note are the following four tools that are designed to generate classes and a mapping file from an existing database:
- reverse-db, included with OJB
- rdbs2j, a tool developed separately from OJB and available from http://sourceforge.net/projects/rdbs2j
- reverse-db2, an update of reverse-db
- the Impart plugin for Eclipse, available from http://www.impart.ch/download
Unfortunately, at the time of this writing none of these tools work. reverse-db cannot read table information from either hsqldb or mysql, although it may work with other databases. rdbs2j is in a beta release, but all the program text is in German (the program itself may work perfectly well for those who can read the menu items and dialogs). reverse-db2 seems to be an early effort, with no functionality implemented yet beyond the ability to explore the database.The fourth option, the Eclipse plugin from Impart, worked with Eclipse 2.1.5 but does not work with 3.0.0. This will likely be fixed in the near future as 3.0.0 matures. For the time being, the following section describes usage of this plugin with 2.1.5.Installation is a simple matter of unzipping the downloaded file in the Eclipse "plugins" directory and then restarting Eclipse.This plugin requires a configuration file called "ImpartOJBGenerator.properties" to be placed in the home directory under Unix variants or C:\Documents and Settings\login_name under Windows. This file contains the typical set of database connection information as well as mappings for JDBC types. See the readme file that accompanies the plugin for more details.The new features that this plug adds to Eclipse are accessible from the "Window" menu. Select "Show view" then "Other . . . " and the pop-up shown in Figure 10.4 will be displayed.
Figure 10.4. The Eclipse other view selector.

Figure 10.5. The OJB DB Tree view.
