In order to get started with Middlegen, you'll have to download and install Ant 1.5 or later.
You also need a database and an execution environment. At the time of this writing, cmp20 is the most commonly used Middlegen plugin, so this tutorial is about CMP. Therefore, the execution environment is an EJB Container. Check if your database and EJB container are supported.
Now, assuming that you have all you need, let's get started. Open the middlegen/samples/build.xml file. This file uses ENTITY includes.
<!DOCTYPE project [
<!ENTITY database SYSTEM "file:./config/database/hsqldb.xml">
<!ENTITY ejb SYSTEM "file:./config/ejb/weblogic.xml">
]>Edit this part of the file and put in the database and EJB container of your choice. It's recommended that you keep the hsqldb setting if you're doing this for the first time. (Hsqldb is included with the distribution).
Next: Create Tables.