| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> |
| <meta http-equiv="Content-Style-Type" content="text/css" /> |
| <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
| <title>Converting a Java project to a JPA project</title> |
| <meta name="copyright" content="Copyright (c) 2000, 2009 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-2.0/. Contributors: Oracle - initial API and implementation" /> |
| <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 1.0.11" /> |
| <meta name="date" content="2013-04-05T12:21:23Z" /> |
| <meta name="robots" content="noarchive" /> |
| <meta name="doctitle" content="Converting a Java project to a JPA project" /> |
| <meta name="relnum" content="Release 3.3" /> |
| <meta name="partnum" content="Release 3.3" /> |
| <link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> |
| <link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> |
| </head> |
| <body> |
| <p><a id="BEIBADHH" name="BEIBADHH"></a></p> |
| <div class="sect1"><!-- infolevel="all" infotype="General" --> |
| <h1>Converting a Java project to a JPA project</h1> |
| <p><a id="sthref72" name="sthref72"></a><a id="sthref73" name="sthref73"></a><a id="sthref74" name="sthref74"></a>Use this procedure to convert an existing Java project to a JPA project.</p> |
| <ol> |
| <li> |
| <p>From the Navigator or Project explorer, right-click the Java project and then select <span class="bold">Configure > Convert to JPA Project.</span> The Project Facets page of the Modify Faceted Project wizard appears.</p> |
| <div class="figure"><a id="sthref75" name="sthref75"></a> |
| <p class="titleinfigure">Modify Faceted Project Page</p> |
| <img src="img/modify_faceted_project.png" alt="" title="" /><br /></div> |
| <!-- class="figure" --></li> |
| <li> |
| <p>Change the <span class="bold">Configuration</span> to <span class="bold">Default JPA Configuration</span>.</p> |
| </li> |
| <li> |
| <p>Click <span class="bold">Next</span>. The Java source page appears (see <a href="task_create_new_project.htm#CIHIFEGJ">Figure: The Java Source Page</a>).</p> |
| </li> |
| <li> |
| <p>Click <span class="bold">Add Folder</span> to add existing Java source files to the project and click <span class="bold">Next</span>. The <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p> |
| <div class="figure"><a id="sthref76" name="sthref76"></a> |
| <p class="titleinfigure">JPA Facet Page</p> |
| <img src="img/new_jpa_facet_task.png" alt="" title="" /><br /></div> |
| <!-- class="figure" --></li> |
| <li> |
| <p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, JPA implementation library, and database connection.</p> |
| <p>Click <span class="bold">Manage libraries</span> to create or update your JPA user libraries. Click <span class="bold">Download libraries</span> to obtain additional JPA implementation libraries.</p> |
| <p>If Dali derives the incorrect schema, select <span class="bold">Override the Default Schema for Connection</span>. Using this option, you can select a development time schema for defaults and validation.</p> |
| <p>If you clear the <span class="bold">Create mapping file (orm.xml)</span> option (which is selected by default), you can later add a mapping file to the project using the <a href="reference007.htm#CIAIJCCE">Create ORM Mapping File wizard</a>.</p> |
| </li> |
| <li> |
| <p>Click <span class="bold">Finish</span>.</p> |
| </li> |
| </ol> |
| <p>The Dali OR Mapping Tool adds the JPA implementation libraries to your project and creates the necessary <code>orm.xml</code> and <code>perisistence.xml</code> files.</p> |
| <a id="sthref77" name="sthref77"></a> |
| <p class="subhead2">Related reference</p> |
| <ul> |
| <li> |
| <p><a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></p> |
| </li> |
| <li> |
| <p><a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a></p> |
| </li> |
| <li> |
| <p><a href="reference007.htm#CIAIJCCE">Create ORM Mapping File wizard</a></p> |
| </li> |
| </ul> |
| <a id="sthref78" name="sthref78"></a> |
| <p class="subhead2">Related tasks</p> |
| <ul> |
| <li> |
| <p><a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></p> |
| </li> |
| <li> |
| <p><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></p> |
| </li> |
| <li> |
| <p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p> |
| </li> |
| </ul> |
| <a id="sthref79" name="sthref79"></a> |
| <p class="subhead2">Related concepts</p> |
| <ul> |
| <li> |
| <p><a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></p> |
| </li> |
| <li> |
| <p><a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a></p> |
| </li> |
| </ul> |
| </div> |
| <!-- class="sect1" --> |
| <!-- Start Footer --> |
| <div class="footer"> |
| <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> |
| <col width="86%" /> |
| <col width="*" /> |
| <tr> |
| <td align="left"><span class="copyrightlogo">Copyright © 2011, 2013, Oracle and/or its affiliates. All rights reserved.</span><br /> |
| <a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> |
| </tr> |
| </table> |
| </div> |
| <!-- class="footer" --> |
| </body> |
| </html> |