Table of Contents
| ||||||||||||||||||
1. Introduction This document presents an overview of EJB 3.0 features available in MyEclipse 6.0. | ||||||||||||||||||
2. EJB 3.0 Project CreationUse the File > EJB Project menu item to invoke the EJB project wizard. Alternatively, you can invoke the EJB project wizard from the New project wizard (File > New > Other).
Create an EJB 3.0 project by selecting the Java EE 5.0 - EJB3 radio button. Optionally add persistence support.
Specify the runtime JNDI data source and select a MyEclipse database driver and schema for design time support.
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.
| ||||||||||||||||||
3. Reverse Engineering Entities and Facades from DatabasesInitiate Entity generation from the context menu of an EJB 3.0 project. This will launch the EJB3 Reverse Engineering Wizard.
Entity generation can also be initiated from the Database Browser view.
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.
Following are several sample snippets of the code generated by the Reverse Engineering process.
| ||||||||||||||||||
4. Advanced Entity Editing Tools |
![]() |
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 |
0 comments:
Post a Comment