(using middlegen preview downloaded from hibernate sourceforge; Middlegen-Hibernate-r4.zip) When using MySQL the relations of the airline example is not detected. As a solution you should download middlegen from the middlegen website and extract the "mysql-connector-java-3.0.0-beta-bin.jar" from the archive and put that into the /lib/ directory. When you do that relations are getting detected.