Oracle® Enterprise Pack for Eclipse User's Guide
Release 12.1.3.3
E57399-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

11 Object-Relational Mappings Support

Object-Relational Mapping Tools are designed to help develop, deploy, and debug ORM JPA applications for Oracle WebLogic Server.

This document contains the following sections about configuring the persistence provider for JPA projects:

11.1 Configuring a JPA Project to Use EclipseLink Persistence Provider

EclipseLink is an open source persistence provider contributed to Eclipse by Oracle.

For more information, see the "EclipseLink User's Guide - Developing JPA Projects" which is available on the Eclipse site at http://wiki.eclipse.org/EclipseLink/UserGuide/Developing_JPA_Projects_%28ELUG%29.

OEPE provides an EclipseLink project facet that you can use in your Eclipse JPA project. When selected, the following happens:

Oracle WebLogic Server releases prior to 11gR1, as well as third-party J2EE application servers, support EclipseLink persistence provider through the user library provider mechanism. For more information, see Section 11.3, "Oracle WebLogic Server Support for Persistence Provider Libraries and Deployment."

To configure your Eclipse JPA project to use EclipseLink as a persistence provider, use one of the methods described below.

To automatically configure your JPA project to use EclipseLink persistence provider shipped with Oracle WebLogic Server 11gR1:

  1. If necessary, create a new JPA project. From the main menu, select File > New > JPA Project.

    In the New JPA Project dialog, choose the Oracle WebLogic Server 11gR1 as the Target Runtime and complete the details on the New Server Runtime Environment dialog.

  2. Click Modify in the Configuration portion on the New JPA Project > JPA Project dialog. This opens the Project Facets dialog.

  3. Select Java Persistence Library (EclipseLink) from the Project Facet list, and then click OK to apply your selection and close the Project Facets dialog.

  4. Click Next on the New JPA Project > JPA Project dialog.

  5. On the next, JPA Facet screen of the New JPA Project dialog, select EclipseLink as the platform for your project.

  6. Specify the database connection in the Connection field.

  7. In the JPA implementation portion of the New JPA Project dialog, select Use implementation provided by server runtime, and then click Next. This opens the New JPA Project > EclipseLink screen.

  8. Select EclipseLink version-number, and then click Finish. Note that if the EclipseLink library is not listed, you need to click Download library. If your machine is located inside of a network, which requires a proxy to access outside resource such as the Internet, the download may fail due to the fact that Eclipse IDE includes a Web browser to let you access the Internet from within the IDE. In this case, reconfigure your Eclipse IDE proxy settings using Window > Preferences > General > Network Connections, and try again.

If you expand your JPA project node in the Project Explorer, and then expand the EclipseLink node, you will find the EclipseLink persistence provider library, as well as Java persistence library.

The persistence.xml file of your JPA project now contains EclipseLink persistence provider settings.

To manually configure a Java user library which includes the EclipseLink JAR files that you downloaded separately:

  1. When creating a new JPA project, select Oracle WebLogic Server 11gR1 as your target runtime.

  2. Click Modify in the Configuration portion on the New JPA Project > JPA Project dialog. This opens the Project Facets dialog.

  3. Select Java Persistence Library (EclipseLink) from the Project Facet list, and then click OK to apply your selection and close the Project Facets dialog.

  4. On the next, JPA Facet screen of the New JPA Project dialog, select EclipseLink as the platform for your project, and then specify the database connection in the Connection field.

  5. In the JPA implementation portion of the New JPA Project > JPA Facet dialog, leave the default selection of Use implementation provided by server runtime, and then click Next. This opens the New JPA Project > EclipseLink dialog. Click Download library. This opens the Download Library dialog. Select the EclipseLink library you would like to use, and click Next. Note that if your machine is located inside of a network, which requires a proxy to access outside resource such as the Internet, the download may fail due to the fact that Eclipse IDE includes a Web browser to let you access the Internet from within the IDE. In this case, reconfigure your Eclipse IDE proxy settings using Window > Preferences > General > Network Connections, and try again.

  6. Add the EclipseLink library to your Eclipse JPA project's build path.

11.2 Configuring a JPA Project to Use Kodo Persistence Provider

Oracle Kodo is the default persistence provider for Oracle WebLogic Server 10n. OEPE enables automatic configuration and deployment of Eclipse JPA projects that use Kodo as their persistence provider on Oracle WebLogic Server.

OEPE provides Oracle Kodo facet that allows you to configure your JPA project to use Oracle Kodo as the persistence provider. When selected, the following happens:

  • The project build path is automatically configured to include Oracle Kodo persistence provider JAR files shipped with Oracle WebLogic Server.

  • The database connection properties specific to Oracle Kodo can be automatically configured in the persistence.xml file of your Eclipse JPA project.


Note:

Earlier versions of Kodo require a build-time class enhancement process. OEPE triggers execution of a Kodo-specific class enhancer on your Kodo JPA project when deployed to Oracle WebLogic Server 10.0. For more information, see Section 11.3, "Oracle WebLogic Server Support for Persistence Provider Libraries and Deployment."

To configure your Eclipse JPA project to use Oracle Kodo as a persistence provider:

  1. When creating a new JPA project, or configuring a Web project or utility with a JPA facet, click Modify next to Configuration on the New JPA Project dialog. This opens the Project Facets dialog.

  2. Select WebLogic Utility Module Extensions and Java Persistence Library (Oracle Kodo) from the Project Facet list, and then click OK to apply your selection and close the Project Facets dialog.

  3. Click Next on the New JPA Project > JPA Project dialog.

  4. On the next, New JPA Project > JPA Facet screen of the New JPA Project dialog, select Generic as the platform for your project.

  5. Specify the database connection in the Connection field, and then click Next. This opens the New JPA Project > Kodo dialog. Select Weblogic System Library (Oracle Kodo 4.2) from the Library > Type combo box.

  6. Click Finish.

If you expand your JPA project node in the Project Explorer, and then expand the WebLogic System Libraries node, you will find the Oracle Kodo persistence provider library, as well as Java persistence library, at the end of the list.

The persistence.xml file of your JPA project now contains Oracle Kodo persistence provider settings.

11.3 Oracle WebLogic Server Support for Persistence Provider Libraries and Deployment

Oracle WebLogic Server 12c (12.1.3) supports the EclipseLink persistence provider.

The following table maps the current version of Oracle WebLogic Server and supported persistence libraries.

Table 11-1 Supported Persistence Libraries

Oracle WebLogic Server Version EclipseLink JPA

12c (12.1.3)

EclipseLink version 2.5.2 and earlier downloadable libraries