posted 1645 days ago
Create a MySQL database with Foreign Key relationships; then install the proper JDBC driver for MySQL; finally point EOModeler to your database to generate the diagram.
- First, make sure you’re working with
InnoDBtables. By default MySQL
MyISAMtables will recognize but not enforce Foreign Key relationships. When creating MySQL tables remember to add
- Next, you’ll need to install the correct driver so Java can connect to MySQL. Download Connector/J to your desktop. As of this writing the most current stable release is 5.0.
- Untar the download and look for the following file:
mysql-connector-java-5.0.6-bin.jar. You need to copy the jar file to your Java Extensions folder. To do so, open terminal and type the following commands:
sudo cp mysql-connector-java-5.0.6-bin.jar /Library/Java/Extension
[Enter your password when prompted]
- Next, you’ll need to install EOModeler if haven’t already. It’s included with WebObjects. Search with Spotlight for
EOModeler. If nothing turns up, or if you hate Spotlight, open finder and look for the following folder:
- If you don’t have EOModeler, you need to install WebObjects. Find your OSX install DVD (darn!) and pop it in your Mac. Browse the contents and look for the WebObjects package, then double click to install. That’s all.
- If you do have EOModeler you can skip to the next step.
- Launch EOModeler and select Model > New to launch the New Model Wizard. In the list of available adapters select
JDBCand click Next.
- Provide the connection information for your MySQL database. The username and password are simply the username and password you use for your particular MySQL database. Enter the following value for your URL:
- The Wizard will next ask you what to include in your model. You might want to uncheck “Ask about relationships” if you have a lot of tables. Click Next.
- Select the tables you want to diagram. For starters, just click Select All and then click Next, then click Finish.
- EOModeler then generates a list of objects, which isn’t so useful. From the Menu, select Tools > Diagram View.
MyISAMtables instead of