This document discusses using Oracle TopLink as a persistence framework with Java Persistence API (JPA) and EJB 3.0. It provides an overview of setting up a TopLink project in JDeveloper, generating entity objects and a session bean, and performing basic CRUD operations. The document demonstrates how to query, insert, update, and delete data using the TopLink APIs.
16. Create a new Application and Workspace in JDeveloper You can type anything for Application Name and Directory Name. In general, JDeveloper like most Java Development Environments will behave inconsistently with spaces between characters so don’t use them in names or directory paths. Choose Web Application [JSF, EJB, TopLink] for the Application Template and click OK.
17.
18. Using JDeveloper wizards to create TopLink objects using EJB 3.0 APIs Be sure to choose EJB and Entities from Tables (JPA/EJB 3.0) when creating the persistence tier
19. Examining the Generated TopLink Entity Objects A Java Entity object will be created for every table that is selected in the wizard. It is possible to also select database views and synonyms for generation. The Entity object contains table metadata, get/set methods for each column and named queries for the Entity. A separate Java object will be created for querying and enforcing primary key constraints.
20.
21.
22. Build a session bean to expose the Entities and provide session functionality From the New Gallery choose Business Tier, EJB, Session Bean (EJB 1.1/2.x/3.0)… Accept all defaults.
23.
24.
25. Build a simple test client To create a test client right click on the SessionEJBBean.java that we generated earlier in the project and choose New Sample Java Client…
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46. EJB 3.0 Java Persistence API (JPA) with Oracle TopLink Bill Lyons Systems Architect Huntsford Consulting [email_address]