Hibernate JPA @StoredProcedureParameter Example

@StoredProcedureParameter

The @StoredProcedureParameter annotation is used to specify a parameter of a @NamedStoredProcedureQuery.

StoredProcedureParameter Specifies a parameter of a named stored procedure query. All parameters of a named stored procedure query must be specified.

Oracle REF_CURSOR named query stored procedure

@NamedStoredProcedureQueries(
    @NamedStoredProcedureQuery(
        name = "sp_person_phones",
        procedureName = "sp_person_phones",
        parameters = {
            @StoredProcedureParameter(
                name = "personId",
                type = Long.class,
                mode = ParameterMode.IN
            ),
            @StoredProcedureParameter(
                name = "personPhones",
                type = Class.class,
                mode = ParameterMode.REF_CURSOR
            )
        }
    )
)

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations