Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm')
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm188
1 files changed, 96 insertions, 92 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
index 92f618b401..47e2327202 100644
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
@@ -3,26 +3,42 @@
<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>Managing the persistence.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
+<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 v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. 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="2012-09-11T7:44:4Z" />
<meta name="robots" content="noarchive" />
<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
+<meta name="relnum" content="Release 3.2" />
+<meta name="partnum" content="Release 3.2" />
<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" />
-<!-- contents -->
</head>
<body>
+<p class="betadraftsubtitle">Beta Draft: 2012-09-11</p>
<p><a id="CIHDAJID" name="CIHDAJID"></a></p>
<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref47" name="sthref47"></a>Managing the persistence.xml file</h1>
-<p><a id="sthref48" name="sthref48"></a>When you create a project, Eclipse creates the <code>META-INF\persistence.xml</code> file in the project's directory.</p>
-<p>You can create a stub <code>persistence.xml</code> file in the META-INF directory when you create a JPA project (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>). You can manage this file either through the XML editor (see ) or through the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
+<h1><a id="sthref93" name="sthref93"></a>Managing the persistence.xml file</h1>
+<p><a id="sthref94" name="sthref94"></a>When you create a project, Eclipse creates the <code>META-INF\persistence.xml</code> file in the project's directory.</p>
+<div class="example"><a id="sthref95" name="sthref95"></a>
+<p class="titleinexample">Sample persistence.xml File</p>
+<pre xml:space="preserve" class="oac_no_warn">
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
+ &lt;persistence-unit name="QuickStart"&gt;
+ &lt;class&gt;quickstart.demo.model.Address&lt;/class&gt;
+ &lt;class&gt;quickstart.demo.model.Item&lt;/class&gt;
+ &lt;/persistence-unit&gt;
+&lt;/persistence&gt;
+</pre></div>
+<!-- class="example" -->
+<p>You can manage this file either through the XML editor or through the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
+<div class="figure"><a id="sthref96" name="sthref96"></a>
+<p class="titleinfigure">The persistence.xml Editor</p>
+<img src="img/persistence_editor_general.png" alt="General tab of persistence.xml editor" title="General tab of persistence.xml editor" /><br /></div>
+<!-- class="figure" -->
<div align="center">
<div class="inftblnote"><br />
<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
@@ -30,38 +46,45 @@
<tr>
<td align="left">
<p class="notep1">Note:</p>
-Depending on your JPA implementation (for example, EclipseLink), the following additional pages may be available in the persistence.xml Editor:
+<p>Depending on your JPA implementation (for example, EclipseLink), the following pages may be available in the persistence.xml Editor:</p>
<ul>
<li>
-<p><a href="reference019.htm#CIAJAFEG">Customization</a></p>
-<p>Use this page to define change-tracking and session customizer-related properties.</p>
+<p><a href="ref_persistence_general.htm#CIACIFGJ">General</a> &ndash;</p>
</li>
<li>
-<p><a href="reference020.htm#CIABEDCH">Caching</a></p>
-<p>Use this page to define caching properties.</p>
+<p><a href="reference046.htm#CIAFFJIE">Connection</a> &ndash;</p>
</li>
<li>
-<p><a href="reference021.htm#CIABGHHI">Logging</a></p>
-<p>Use this page to define logging properties.</p>
+<p><a href="reference047.htm#CIAJAFEG">Customization</a> &ndash; Use this page to define change-tracking and session customizer-related properties.</p>
</li>
<li>
-<p><a href="reference022.htm#CIAFJCHE">Options</a></p>
-<p>Use this page to define session and target database properties.</p>
+<p><a href="reference048.htm#CIABEDCH">Caching</a> &ndash; Use this page to define caching properties.</p>
</li>
<li>
-<p><a href="reference023.htm#CIACCFCB">Schema Generation</a></p>
-<p>Use this page to define DDL-related properties.</p>
+<p><a href="reference049.htm#CIABGHHI">Logging</a> &ndash; Use this page to define logging properties.</p>
+</li>
+<li>
+<p><a href="reference050.htm#CIAFJCHE">Options</a> &ndash; Use this page to define session and target database properties.</p>
+</li>
+<li>
+<p><a href="reference051.htm#CIACCFCB">Schema Generation</a> &ndash; Use this page to define DDL-related properties.</p>
+</li>
+<li>
+<p><a href="reference052.htm#CIAHJDFF">Properties</a> &ndash;</p>
+</li>
+<li>
+<p><a href="reference053.htm#CIAHCJAH">Source</a> &ndash;</p>
</li>
</ul>
<p>For projects using the EclipseLink JPA implementation, the Connections page also includes JDBC connection pool properties.</p>
-<p>If the project uses the Generic platform, then only the <a href="ref_persistence_general.htm#CIACIFGJ">General</a>, <a href="reference018.htm#CIAFFJIE">Connection</a>, <a href="reference024.htm#CIAHJDFF">Properties</a> and <a href="reference025.htm#CIAHCJAH">Source</a> pages are available.</p>
+<p>If the project uses the Generic platform, then only the <a href="ref_persistence_general.htm#CIACIFGJ">General</a>, <a href="reference046.htm#CIAFFJIE">Connection</a>, <a href="reference052.htm#CIAHJDFF">Properties</a> and <a href="reference053.htm#CIAHCJAH">Source</a> pages are available.</p>
</td>
</tr>
</tbody>
</table>
<br /></div>
<!-- class="inftblnote" --></div>
-<p>To use the <code>persistence.xml</code> Editor:</p>
+<p>To use the persistence.xml Editor:</p>
<ol>
<li>
<p>Open the <code>peristence.xml</code> file. The <a href="ref_persistence_general.htm#CIACIFGJ">General</a> page of the editor appears.</p>
@@ -75,66 +98,22 @@ Depending on your JPA implementation (for example, EclipseLink), the following a
<tr>
<td align="left">
<p class="notep1">Tip:</p>
-The persistence.xml Editor's Source page enables you to view and edit the raw XML file.</td>
+<p>The persistence.xml Editor's Source page enables you to view and edit the raw XML file.</p>
+</td>
</tr>
</tbody>
</table>
<br /></div>
<!-- class="inftblnotealso" --></div>
-<div class="inftblinformal">
-<table class="Informal" summary="This table lists the properties of the persistence.xml editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="29%" />
-<col width="29%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Element Defined</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Name</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Enter the name of the persistence unit.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8"><code>&lt;persistence-unit name = "&lt;Name&gt;"&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8"><a id="sthref49" name="sthref49"></a>Persistence Provider</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Enter the name of the persistence provider.</td>
-<td align="left" headers="r3c1-t8 r1c3-t8"><code>&lt;provider&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Description</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Enter a description for this persistence unit. This is an optional property.</td>
-<td align="left" headers="r4c1-t8 r1c3-t8"><code>&lt;description&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8"><a id="sthref50" name="sthref50"></a>Managed Classes</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Add or remove the classes managed through the persistence unit.</td>
-<td align="left" headers="r5c1-t8 r1c3-t8"><code>&lt;class&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">&nbsp;&nbsp;Exclude&nbsp;Unlisted&nbsp;Classes</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Select to include all annotated entity classes in the root of the persistence unit.</td>
-<td align="left" headers="r6c1-t8 r1c3-t8"><code>&lt;exclude-unlisted-classes&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t8" headers="r1c1-t8">XML&nbsp;Mapping&nbsp;Files</td>
-<td align="left" headers="r7c1-t8 r1c2-t8">Add or remove the object/relational mapping XML files define the classes managed through the persistence unit.</td>
-<td align="left" headers="r7c1-t8 r1c3-t8"><code>&lt;mapping-file&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t8" headers="r1c1-t8">JAR&nbsp;Files</td>
-<td align="left" headers="r8c1-t8 r1c2-t8">Add or remove additional JAR files and libraries</td>
-<td align="left" headers="r8c1-t8 r1c3-t8"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></li>
+<div class="figure"><a id="sthref97" name="sthref97"></a>
+<p class="titleinfigure">General tab of persistence.xml Editor</p>
+<img src="img/persistence_editor_general.png" alt="General tab of persistence.xml editor" title="General tab of persistence.xml editor" /><br /></div>
+<!-- class="figure" --></li>
<li>
-<p>Use the <a href="reference018.htm#CIAFFJIE">Connection</a> page to define the <code>&lt;jta-data-source&gt;</code> and <code>&lt;non-jta-data-source&gt;</code> elements as follows:</p>
+<p>Complete each field on the <a href="ref_persistence_general.htm#CIACIFGJ">General</a> page.</p>
+</li>
+<li>
+<p>Use the <a href="reference046.htm#CIAFFJIE">Connection</a> page to define the <code>&lt;jta-data-source&gt;</code> and <code>&lt;non-jta-data-source&gt;</code> elements as follows:</p>
<p>To configure the JTA (Java Transaction API) source used by the persistence provider:</p>
<ol>
<li>
@@ -158,7 +137,8 @@ The persistence.xml Editor's Source page enables you to view and edit the raw XM
<tr>
<td align="left">
<p class="notep1">Note:</p>
-Select <span class="bold">Default()</span> to use the data source provided by the container.</td>
+<p>Select <span class="bold">Default()</span> to use the data source provided by the container.</p>
+</td>
</tr>
</tbody>
</table>
@@ -166,7 +146,13 @@ Select <span class="bold">Default()</span> to use the data source provided by th
<!-- class="inftblnote" --></div>
</li>
</ol>
-<p><a id="sthref51" name="sthref51"></a>For projects using the Generic platform, you can also define the EclipseLink connection pool driver, connection pool driver, URL, user name and password.</p>
+<p><a id="sthref98" name="sthref98"></a>For projects using the Generic platform, you can also define the EclipseLink connection pool driver, connection pool driver, URL, user name and password.</p>
+<div class="figure"><a id="sthref99" name="sthref99"></a>
+<p class="titleinfigure">Connection tab of persistence.xml Editor</p>
+<img src="img/persistence_editor_connection.png" alt="Connection tab of persistence.xml Editor" title="Connection tab of persistence.xml Editor" /><br /></div>
+<!-- class="figure" --></li>
+<li>
+<p>Complete each field on the <a href="reference046.htm#CIAFFJIE">Connection</a> page.</p>
</li>
<li>
<p>Use the table in the Properties page to set the vendor-specific <code>&lt;properties&gt;</code> element.</p>
@@ -187,36 +173,54 @@ Select <span class="bold">Default()</span> to use the data source provided by th
<tr>
<td align="left">
<p class="notep1">Note:</p>
-If the project uses the EclipseLink platform, the connection page also includes parameters for JDBC connection pooling.</td>
+<p>If the project uses the EclipseLink platform, the connection page also includes parameters for JDBC connection pooling.</p>
+</td>
</tr>
</tbody>
</table>
<br /></div>
<!-- class="inftblnote" --></div>
+<div class="figure"><a id="sthref100" name="sthref100"></a>
+<p class="titleinfigure">Customization tab of persistence.xml Editor</p>
+<img src="img/persistence_editor_customization.png" alt="Customization tab of persistence.xml Editor" title="Customization tab of persistence.xml Editor" /><br /></div>
+<!-- class="figure" --></li>
+<li>
+<p>Complete each field on the <a href="reference047.htm#CIAJAFEG">Customization</a> page.</p>
</li>
</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks002.htm#CIHFEBAI">Synchronizing classes</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
+<p>Additional pages may be available for the persistence.xml editor, depending on your JPA provider. See <a href="ref_persistence_xmll_editor.htm#CIACCHID">"persistence.xml Editor"</a> for more information.</p>
+<a id="sthref101" name="sthref101"></a>
+<p class="subhead2">Related reference</p>
+<ul>
+<li>
+<p><a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a></p>
+</li>
+</ul>
+<a id="sthref102" name="sthref102"></a>
+<p class="subhead2">Related tasks</p>
+<ul>
+<li>
+<p><a href="tasks006.htm#CIHFEBAI">Synchronizing classes</a></p>
+</li>
+</ul>
+<a id="sthref103" name="sthref103"></a>
+<p class="subhead2">Related concepts</p>
+<ul>
+<li>
+<p><a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a></p>
+</li>
+</ul>
<!-- 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&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
+<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2011, 2012,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
</tr>
</table>
</div>
<!-- class="footer" --></div>
</body>
-</html>
+</html> \ No newline at end of file

Back to the top