-
@Target(value=TYPE) @Retention(value=RUNTIME) public @interface NamedStoredProcedureQuery
Specifies and names a stored procedure, its parameters, and its result type.The
NamedStoredProcedureQuery
annotation can be applied to an entity or mapped superclass.The
name
element is the name that is passed as an argument to theEntityManager.createNamedStoredProcedureQuery(java.lang.String)
method to create an executableStoredProcedureQuery
object. Names are scoped to the persistence unit.The
procedureName
element is the name of the stored procedure in the database.The parameters of the stored procedure are specified by the
parameters
element. All parameters must be specified in the order in which they occur in the parameter list of the stored procedure.The
resultClasses
element refers to the class (or classes) that are used to map the results. TheresultSetMappings
element names one or more result set mappings, as defined by theSqlResultSetMapping
annotation.If there are multiple result sets, it is assumed that they will be mapped using the same mechanism — 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
resultClasses
orresultSetMappings
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.The
hints
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.All parameters of a named stored procedure query must be specified using the
StoredProcedureParameter
annotation.- Since:
- Java Persistence 2.1
- See Also:
StoredProcedureQuery
,StoredProcedureParameter
-
-
Required Element Summary
Required Elements Modifier and Type Required Element and Description String
name
The name used to refer to the query with theEntityManager
methods that create stored procedure query objects.String
procedureName
The name of the stored procedure in the database.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element and Description QueryHint[]
hints
Query properties and hints.StoredProcedureParameter[]
parameters
Information about all parameters of the stored procedure.Class[]
resultClasses
The class or classes that are used to map the results.String[]
resultSetMappings
The names of one or more result set mappings, as defined in metadata.
-
-
-
Element Detail
-
name
public abstract String name
The name used to refer to the query with theEntityManager
methods that create stored procedure query objects.
-
-
-
procedureName
public abstract String procedureName
The name of the stored procedure in the database.
-
-
-
parameters
public abstract StoredProcedureParameter[] parameters
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.- Default:
- {}
-
-
-
resultClasses
public abstract Class[] resultClasses
The class or classes that are used to map the results.- Default:
- {}
-
-
-
resultSetMappings
public abstract String[] resultSetMappings
The names of one or more result set mappings, as defined in metadata.- Default:
- {}
-
-
-
hints
public abstract QueryHint[] hints
Query properties and hints. (May include vendor-specific query hints.)- Default:
- {}
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/persistence/namedstoredprocedurequery.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.