Outline
1. Preface
2. Requirements
3. Introduction
4. Creating an ER Diagram from a Database
5. Working with an Entity-Relationship Diagram
1. Notation and Presentation Basics
2. Refreshing Table and ER Diagram Data
3. Relationship Routing and Rerouting
4. Visual Grid, Table Alignment, Table Resizing
5. Locating and Selecting Tables
6. Exporting an ER Diagram
7. Configuring The ER-Designer
8. Summary
9. User Feedback
10.References
1. Preface
This document was written using Sun JDK 1.4.2, Eclipse 3.1, MyEclipse 4.0 and MyEclipse Database Explorer with a
demonstration Oracle9i server. All screenshots are based upon the default user interface settings for Eclipse,
MyEclipse Enterprise Workbench, and Windows XP. If you experience difficulty with the instruction of this document,
please see the User Feedback section for how to provide feedback to the MyEclipse documentation team.
Back to Top
2. Requirements
Below is a list of requirements for this Quickstart:
1. Java 2 SDK, Standard Edition 1.4 or later installed (see Resources for a download link)
2. Eclipse 3.1 SDK (see Resources for a download link)
3. MyEclipse 4.0 (see Resources for a download link)
4. A database server that is supported by the MyEclipse Database Explorer
5. The MyEclipse Database Explorer configured to browse a sample database
Back to Top
3. Introduction
The MyEclipse ER-Designer is a maturing feature set that will ultimately enable developers to visually manage the full
life-cycle of a relational database from design, through implementation, and maintenance. The MyEclipse ER-Designer
is the initial public version and its features are limited to providing a visual model of existing databases. The ER-
Designer utilizes the database connectors of the Database Explorer to access a database's metadata as it reverse
engineers the database's entity-relationship (ER) model. From that, the ER-Designer renders the model using the
Information Engineering (IE) System for ER as an entity-relation diagram (ERD). At any time the ER-Designer can
resynchronize an ERD with its database to accurately reflect the current state of the database. The ER-Design includes
a sophisticated table and relationship layout engine that enables it to quickly layout/relayout an ERD.
The ER-Designer provides numerous tools and features that enable you to create, reorganize and customize an ER,
and to export the ER as a JPEG image. This Quickstart will demonstrate how to use these tools to accomplish the
following tasks:
Back to Top
1. Open the Database Explorer perspective. From the menubar select Window > Open Perspective > Other... >
MyEclipse Database Explorer
2. From the Database Browser view select the database or schema for which to create an ER diagram
3. From the context-menu (right-click) select the Create ER Diagram action (see Figure 2).
4. From the New ER Diagram File Wizard, select the project and specify the name of the new ER diagram file.
Note that the ".mer" is the default file extension used by the ER Designer . If your workspace has no
projects, the Projects list will be empty and you will need to cancel the process, create a project, and then
resume this process.
5. In the New ER Diagram wizard select OK to initiate the database analysis and diagram creation process.
Reverse engineering an ER diagram from a database requires that the ER-Designer download and
analyze the database's metadata. Depending upon the size of your database and the DB server
connection performance, the metadata retrieval process could be time consuming. Therefore you may
choose to run the process in the background by selecting the Run in Background action in the ERD
creation monitor (see Figure 4).
Upon completion of the process the new HR.mer file has been created.
Figure 5. Workbench with newly created HR.mer file
Back to Top
Back to Top
The ER-Designer supports the Information Engineering for ER notation, a.k.a., crows feet notation. During the reverse
engineering process only the cardinality of the child entity of a parent-child relationship is depicted. Figure 6 depicts an
annotated relation. Notice that the details compartment of a table defines each table column, the column's type, and its
role, such as a primary or foreign key. Table 1 defines the meaning of the icons and text styles used in the table details
compartment.
Tables
Tables may be repositioned to any location on the ER-Designer by selecting a table and dragging it to a new location.
Any relocation operation may be reversed using the Eclipse UNDO command or its equivalent keyboard short-cut (e.g.,
ctrl-z). When a table is selected it is presented with a distinct highlighted background color. In Figure 6, the JOBS table
appears as a selected table.
or Foreign Key
Expand/Collapse details
/
compartment
Relationships
A relationship is depicted as a directed, labeled connection between 2 database table entities. The connection's label is
based on the pattern: parentTable(column1,...)= childTable(column1,...) mapping. Next to the relationship label is a
direction arrow that points from the parent table to the child table (->). When you fly-over a connection, the foreign key
constraint name is displayed. For example the JHIST_JOB_FK constraint is depicted in Figure 6 just below the relation
in bright blue text.
One or more
Zero or more
Zero or one
Back to Top
An ER diagram can be refreshed (i.e., resynchronized) with the current state of the database from which it was derived.
The refresh process involves retrieving database metadata and reconciling it with the state of the ER diagram. ER
diagram refreshing can be performed on selected tables or the entire diagram can be refreshed.
Back to Top
Relationship connections may be manually rerouted by selecting the target relationship and then dragging bend-points
on the connection. When a relationship is selected, the diagram changes as follows:
A relationship that has been manually routed can be automatically rerouted using the MyEclipse Layout Engine. This
feature is useful when manually routing produces undesirable results and the user wishes to return to auto-layout of a
relationship. To do so, select the relationship that has been manually rerouted. Then from the context-menu (right-click
menu) select the Reroute action (see Figure 8). The Layout Engine will reroute the relationship using its optimization
algorithm.
Back to Top
The ER-Designer provides a visual grid and grid alignment and table sizing tools to help you manually layout tables
and relationship routing in a uniform and aesthetically pleasing style.
Snap To Grid - The Snap To Grid feature facilitates the manual alignment of tables and relationships by constraining
their placement to align with vertical and horizontal grid lines. The Grid is NOT required to be visible for this feature to
be activated. To toggle the Snap to Grid feature on/off do the following:
Horizontal and Vertical Alignment Tools - The ER-Design contributes table alignment tools to the MyEclipse toolbar.
To align 1 or more tables do the following:
Table Resizing Tools - The ER-Designer contributes table resizing tools to the MyEclipse toolbar. To resize 1 or more
tables do the following:
Back to Top
To view and select a table from the outline view do the following:
1. If the Outline View is not already opened, then from the menubar select Window > Show View > Basic >
Outline
2. Scroll the Outline View to the desired table and select it. This will cause the corresponding ER-Diagram table to
be highlighted and scrolled into view.
For example Figure 15 shows the JOB_HISTORY table selected in the outline view and the corresponding ER digram
table symbol highlighted and visible.
In addition to using the Outline View to locate your tables of interest, the ER-Designer provides the Table Locator, a
pop-up dialog with a fast text search feature.The Table Locator is launched by from either the ER-Designer's context-
menu, the Navigate menubar, or the Outline toolbar. This example will use the Outline toolbar action to launch the
Table Locator.
1. From the Outline toolbar select the search icon (see Figure X)
3. If your table is not in view of the dialog type in the first few characters of its name and the list will quickly filter to
the set table names that have a prefix of the string that you entered
4. Select your table of interest
5. Select OK to complete the search process
The Table Locator Dialog will close and the ER-Designer will scroll the selected table into view and highlight it in a
manner similar to the Outline View location.
Back to Top
6. Exporting a Diagram
The ER-Designer enables you to export ERDs in the JPEG image format. To export an ERD, from the context-menu
select the Export As JPEG... action. This will open a file selection dialog for you to specify the location of the new
JPEG image. The export action can be seen in the context-menu of Figure 18.
Note: A large ERD can easily require 100's of megabytes to represent it in image format. In some cases this may
result in failure of the export operation as the image is too large to manage in version 3.8.3. A future version of the ER-
Design will optimize the image export memory requirements.
Figure 18. Export As JPEG image action
Back to Top
8. Summary
This concludes the introduction to the MyEclipse ER-Designer features and their use. Additional Quickstart documents
are available that introduce working with Hibernate along with the Database Explorer, as well as working Web Projects,
editing HTML, application server configuration, and enterprise application projects. For more information visit the
MyEclipse Application Developer Help topic.
Back to Top
9. User Feedback
If you have comments or suggestions regarding this document please submit them to the MyEclipse Documentation
Forum .
Back to Top
10. References
• Introduction to Data Modeling
• Download Java 2 SDK, Standard Edition 1.4 from Sun Microsystems.
• Download Eclipse 3.1 SDK or greater from the Eclipse Foundation
• Download the MyEclipse 4.0 30 day trial edition; portal registration is required.
• Visit the MyEclipse Quickstart Library for more MyEclipse tutorials.
Back to Top