Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents
 Search
 PDFComments
Comments


@NamedStoredProcedureQueries

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

value

(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: