Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsapir2010-05-19 18:24:44 +0000
committerrsapir2010-05-19 18:24:44 +0000
commit8bb59dc672ca26d67f5c1336c6953da78db0d0f2 (patch)
tree046129889ed9bf0899ec117f6c752efba7a551fa /jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
parente93453039c975c0565ed73da73fef5fcf6d9fc64 (diff)
downloadwebtools.dali-8bb59dc672ca26d67f5c1336c6953da78db0d0f2.tar.gz
webtools.dali-8bb59dc672ca26d67f5c1336c6953da78db0d0f2.tar.xz
webtools.dali-8bb59dc672ca26d67f5c1336c6953da78db0d0f2.zip
dali 2.3 docs r2. bug 312815
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm')
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm61
1 files changed, 40 insertions, 21 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
index 55a6ed15f1..1b5054e055 100644
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ b/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
@@ -6,11 +6,11 @@
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating Named Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1 Build 004" />
-<meta name="date" content="2010-01-22T9:29:46Z" />
+<title>Mapped superclass</title>
+<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
+<meta name="date" content="2010-05-19T8:12:43Z" />
<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating Named Queries" />
+<meta name="doctitle" content="Mapped superclass" />
<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" />
<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
@@ -18,36 +18,55 @@
<!-- contents -->
</head>
<body>
-<p><a id="BABIGBGG" name="BABIGBGG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating Named Queries</h1>
-<p><a id="sthref105" name="sthref105"></a><a id="sthref106" name="sthref106"></a>Named queries improve application performance because they are prepared once and they (and all of their associated supporting objects) can be efficiently reused thereafter, making them well suited for complex and frequently executed operations. Named queries use the JPA query language for portable execution on any underlying database; named native queries use the SQL language native to the underlying database.</p>
-<p>Use this procedure to add <code>@NamedQuery</code> and <code>@NamedNativeQuery</code> annotations to the entity.</p>
-<p>To create a named query:</p>
-<ol>
+<p><a id="BABDAGCI" name="BABDAGCI"></a></p>
+<div class="sect2"><!-- infolevel="all" infotype="General" -->
+<h1>Mapped superclass</h1>
+<p><a id="sthref85" name="sthref85"></a><a id="sthref86" name="sthref86"></a>An entity that extends a <span class="bold">Mapped Superclass</span> class inherits the persistent state and mapping information from a superclass. You should use a mapped superclass to define mapping information that is common to multiple entity classes.</p>
+<p>A mapped superclass <span class="italic">can be</span>:</p>
+<ul>
+<li>
+<p>Abstract or concrete classes</p>
+</li>
+</ul>
+<p>A mapped superclass <span class="italic">cannot be</span>:</p>
+<ul>
<li>
-<p>Select the entity in the Project Explorer.</p>
+<p>Be queried or passed as an argument to Entity-Manager or Query operations</p>
</li>
<li>
-<p>In the JPA Details view, expand Queries.</p>
+<p>Be the target of a persistent relationship</p>
</li>
+</ul>
+<p>A mapped superclass does not have a defined database table. Instead, its mapping information is derived from its superclass. To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
+<p><a id="sthref87" name="sthref87"></a><a id="sthref88" name="sthref88"></a><a id="sthref89" name="sthref89"></a><a id="sthref90" name="sthref90"></a>A mapped superclass is identified by the <code>@MappedSuperclass</code> annotation.</p>
+<p>Use this procedure to add Mapped Superclass persistence to an existing entity:</p>
+<ol>
<li>
-<p>Click <span class="bold">Add</span> for a named query, or <span class="bold">Add Native</span> for a native query.</p>
+<p>Open the Java class in the <span class="gui-object-title">Project Explorer</span>.</p>
</li>
<li>
-<p>In the dialog that appears, enter the name of the query in the Name field and then click OK.</p>
+<p>Select the class in the JPA Structure view.</p>
</li>
<li>
-<p>Enter the query in the Query field.</p>
+<p>In the JPA Details view, click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
</li>
<li>
-<p><a id="sthref107" name="sthref107"></a><a id="sthref108" name="sthref108"></a><a id="sthref109" name="sthref109"></a><a id="sthref110" name="sthref110"></a>To add a Query hint, click <span class="bold">Add</span>.</p>
-<div class="figure"><a id="sthref111" name="sthref111"></a>
-<p class="titleinfigure">Entering a Named Query</p>
-<img src="img/task_entering_query.png" alt="The Queries section of the JPA Details view." title="The Queries section of the JPA Details view." /><br /></div>
+<p>Select <span class="bold">Mapped Superclass</span> and then <span class="bold">OK</span>.</p>
+<div class="figure"><a id="sthref91" name="sthref91"></a>
+<p class="titleinfigure">Mapping Type Selection Dialog (Mapped Superclass)</p>
+<img src="img/mapping_type_selection_superclass.png" alt="The Mapping Type Selection dialog with Mapped Superclass selected." title="The Mapping Type Selection dialog with Mapped Superclass selected." /><br /></div>
<!-- class="figure" --></li>
+<li>
+<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
+</li>
</ol>
-</div>
+<p>&nbsp;</p>
+<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
+<br />
+<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
+<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
+<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
+<!-- class="sect2" -->
<!-- class="sect1" -->
<!-- Start Footer -->
<div class="footer">

Back to the top