|
|
This document presents an overview of EJB 3.0 features available
in MyEclipse.
To get a better feel for MyEclipse and learning more about it,
please check out our product
Documentation for more
material.
|
|
|
Launch the EJB Project wizard by selecting the EJB Project option from the new toolbar menu:
|
|
Figure 2.1. Creating a new EJB 3.0
project
|
Create an EJB 3.0 project by selecting the Java EE 5.0 - EJB3
radio button. Optionally add persistence support.
|
|
Figure 2.2. New EJB Project wizard
- Page 1
|
Specify the runtime JNDI data source and select a MyEclipse
database driver and schema for design time support.
|
|
Figure 2.3. New EJB Project wizard
- Page 2, persistence configuration
|
You may change the EJB 3.0 project's design time driver
association at any time using the
Java Persistence properties page. To invoke this
page, right click on the project and select Properties from the
context menu. From the Properties dialog shown below, expand the
MyEclipse node and select Java Persistence.
|
|
Figure 2.4. Java Persistence
properties page
|
|
|
Initiate Entity generation from the context menu of an EJB 3.0
project. This will launch the EJB3 Reverse Engineering Wizard.
|
|
Figure 3.1. Entity generation from
an EJB 3.0 project
|
Entity generation can also be initiated from the Database Browser
view.
|
|
Figure 3.2. Entity generation from
a DB Table
|
The reverse engineering process is fully customizable. Using the
EJB3 Reverse Engineering Wizard you can choose the artifacts to
generate and the database tables from which the artifacts will be
based.
|
|
Figure 3.3. Select artifacts to be
reverse engineered
|
Following are several sample snippets of the code generated by
the Reverse Engineering process.
|
|
Figure 3.4. Snippets of generated
code
|
|
a) MyEclipse Java Persistence Perspective
|
|
Figure 4.1. MyEclipse Java
Persistence perspective
|
b) JPA Details View
The JPA Details view makes it easy to edit entity annotations.
|
|
Figure 4.2. JPA Details view -
Editing table details
|
|
|
Figure 4.3. JPA Details view -
Editing column details
|
c) JPA Annotation Table and Column Content Assist
|
|
Figure 4.4. Table content assist
|
|
|
Figure 4.5. JPA column content
assist
|
d) JPA Entity Validation
Errors in your mapping are detected and displayed in the editor
and problems view.
|
|
Figure 4.6 Column validation in the
Java editor
|
|
|
Figure 4.7 Mapped by validation in
the Java editor
|
|
Figure 4.8. JPA validation errors
shown in Java editor
|
The
JPA Entity Validator can be enabled or disabled
at the project level.
|
|
Figure 4.9 JPA validation
preferences
|
|
|
We would like to hear from you! If you liked this overview, have
some suggestions or even some corrections for us please let us
know. We track all user feedback about our learning material in
our
Documentation Forum.
Please be sure to let us know which piece of MyEclipse material
you are commenting on so we can quickly pinpoint any issues that
arise.
|