blob: 39657e160973398e19af967007e30c0710b1b701 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>NamedStoredProcedureQuery</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NamedStoredProcedureQuery";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../javax/persistence/NamedStoredProcedureQueries.html" title="annotation in javax.persistence"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../javax/persistence/NamedSubgraph.html" title="annotation in javax.persistence"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?javax/persistence/NamedStoredProcedureQuery.html" target="_top">Frames</a></li>
<li><a href="NamedStoredProcedureQuery.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.persistence</div>
<h2 title="Annotation Type NamedStoredProcedureQuery" class="title">Annotation Type NamedStoredProcedureQuery</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@Repeatable(value=<a href="../../javax/persistence/NamedStoredProcedureQueries.html" title="annotation in javax.persistence">NamedStoredProcedureQueries.class</a>)
@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface <span class="memberNameLabel">NamedStoredProcedureQuery</span></pre>
<div class="block">Specifies and names a stored procedure, its parameters, and its result type.
<p>The <code>NamedStoredProcedureQuery</code> annotation can be applied to an
entity or mapped superclass.
<p>The <code>name</code> element is the name that is passed as an argument to the
<a href="../../javax/persistence/EntityManager.html#createNamedStoredProcedureQuery-java.lang.String-"><code>EntityManager.createNamedStoredProcedureQuery(java.lang.String)</code></a>
method to create an executable <code>StoredProcedureQuery</code> object.
Names are scoped to the persistence unit.
<p>The <code>procedureName</code> element is the name of the stored procedure in
the database.
<p>The parameters of the stored procedure are specified by the
<code>parameters</code> element. All parameters must be specified in the order in
which they occur in the parameter list of the stored procedure.
<p>The <code>resultClasses</code> element refers to the class (or classes) that are
used to map the results. The <code>resultSetMappings</code> element names one or
more result set mappings, as defined by the <a href="../../javax/persistence/SqlResultSetMapping.html" title="annotation in javax.persistence"><code>SqlResultSetMapping</code></a>
annotation.
<p>If there are multiple result sets, it is assumed that they will be
mapped using the same mechanism &#8212; e.g., either all via a set of
result class mappings or all via a set of result set mappings. The
order of the specification of these mappings must be the same as
the order in which the result sets will be returned by the stored
procedure invocation. If the stored procedure returns one or more
result sets and no <code>resultClasses</code> or <code>resultSetMappings</code>
element is specified, any result set will be returned as a list of type
Object[]. The combining of different strategies for the mapping of
stored procedure result sets is undefined.
<p>The <code>hints</code> element may be used to specify query properties and
hints. Properties defined by this specification must be observed by
the provider. Vendor-specific hints that are not recognized by a
provider must be ignored.
<p>All parameters of a named stored procedure query must be specified
using the <code>StoredProcedureParameter</code> annotation.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>Java Persistence 2.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../javax/persistence/StoredProcedureQuery.html" title="interface in javax.persistence"><code>StoredProcedureQuery</code></a>,
<a href="../../javax/persistence/StoredProcedureParameter.html" title="annotation in javax.persistence"><code>StoredProcedureParameter</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.required.element.summary">
<!-- -->
</a>
<h3>Required Element Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Required Element Summary table, listing required elements, and an explanation">
<caption><span>Required Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Required Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/NamedStoredProcedureQuery.html#name--">name</a></span></code>
<div class="block">The name used to refer to the query with the <a href="../../javax/persistence/EntityManager.html" title="interface in javax.persistence"><code>EntityManager</code></a>
methods that create stored procedure query objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/NamedStoredProcedureQuery.html#procedureName--">procedureName</a></span></code>
<div class="block">The name of the stored procedure in the database.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.optional.element.summary">
<!-- -->
</a>
<h3>Optional Element Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Optional Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../javax/persistence/QueryHint.html" title="annotation in javax.persistence">QueryHint</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/NamedStoredProcedureQuery.html#hints--">hints</a></span></code>
<div class="block">Query properties and hints.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../javax/persistence/StoredProcedureParameter.html" title="annotation in javax.persistence">StoredProcedureParameter</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/NamedStoredProcedureQuery.html#parameters--">parameters</a></span></code>
<div class="block">Information about all parameters of the stored procedure.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Class[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/NamedStoredProcedureQuery.html#resultClasses--">resultClasses</a></span></code>
<div class="block">The class or classes that are used to map the results.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/persistence/NamedStoredProcedureQuery.html#resultSetMappings--">resultSetMappings</a></span></code>
<div class="block">The names of one or more result set mappings, as defined in metadata.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.element.detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a name="name--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>name</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;name</pre>
<div class="block">The name used to refer to the query with the <a href="../../javax/persistence/EntityManager.html" title="interface in javax.persistence"><code>EntityManager</code></a>
methods that create stored procedure query objects.</div>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="procedureName--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>procedureName</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;procedureName</pre>
<div class="block">The name of the stored procedure in the database.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="parameters--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parameters</h4>
<pre>public abstract&nbsp;<a href="../../javax/persistence/StoredProcedureParameter.html" title="annotation in javax.persistence">StoredProcedureParameter</a>[]&nbsp;parameters</pre>
<div class="block">Information about all parameters of the stored procedure.
All parameters must be specified in the order in which they
occur in the parameter list of the stored procedure.</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="resultClasses--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resultClasses</h4>
<pre>public abstract&nbsp;java.lang.Class[]&nbsp;resultClasses</pre>
<div class="block">The class or classes that are used to map the results.</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="resultSetMappings--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resultSetMappings</h4>
<pre>public abstract&nbsp;java.lang.String[]&nbsp;resultSetMappings</pre>
<div class="block">The names of one or more result set mappings, as defined in metadata.</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="hints--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hints</h4>
<pre>public abstract&nbsp;<a href="../../javax/persistence/QueryHint.html" title="annotation in javax.persistence">QueryHint</a>[]&nbsp;hints</pre>
<div class="block">Query properties and hints. (May include vendor-specific query hints.)</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../javax/persistence/NamedStoredProcedureQueries.html" title="annotation in javax.persistence"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../javax/persistence/NamedSubgraph.html" title="annotation in javax.persistence"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?javax/persistence/NamedStoredProcedureQuery.html" target="_top">Frames</a></li>
<li><a href="NamedStoredProcedureQuery.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>