Use @NamedStoredProcedureQueries
annotation to define multiple NamedStoredProcedureQuery
items.
Annotation Elements
Table 2-40 describes this annotation's elements.
Table 2-40 @NamedStoredProcedureQueries Annotation Elements
Annotation Element | Description | Default |
---|---|---|
|
(Required) An array of named stored procedure query. |
Examples
Example 2-73 shows how to use this annotation.
Example 2-73 Using @NamedStoredProcedureQueries Annotation
@Entity @Table(name="EMPLOYEE") @NamedStoredProcedureQueries({ @NamedStoredProcedureQuery( name="ReadEmployeeInOut", resultClass=org.eclipse.persistence.testing.models.jpa.customfeatures.Employee.class, procedureName="Read_Employee_InOut", parameters={ @StoredProcedureParameter(direction=IN_OUT, name="employee_id_v", queryParameter="ID", type=Integer.class), @StoredProcedureParameter(direction=OUT, name="nchar_v", queryParameter="NCHARTYPE", type=Character.class)} ), @NamedStoredProcedureQuery( name="ReadEmployeeCursor", resultClass=org.eclipse.persistence.testing.models.jpa.customfeatures.Employee.class, procedureName="Read_Employee_Cursor", parameters={ @StoredProcedureParameter(direction=IN, name="employee_id_v", queryParameter="ID", type=Integer.class), @StoredProcedureParameter(direction=OUT_CURSOR, queryParameter="RESULT_CURSOR")}) }) public class Employee implements Serializable {
To define multiple named stored procedure queries in the eclipselink-orm.xml
file, simply create a list of multiple <named-stored-procedure_query>
elements.
See Also
For more information, see:
"Stored Procedures" in Understanding EclipseLink