NativeSQLQueryConstructorReturn is not processed by SQLQueryReturnProcessor

Description

I am trying to call a stored procedure with 2 OUT parameters. I have declared a NamedStoredProcedureQuery referencing a SqlResultSetMapping:
{{
@NamedStoredProcedureQuery(name = "set_handler", procedureName = "API_CUSTOMER_PKG.set_handler",
parameters = {
@StoredProcedureParameter(mode = ParameterMode.IN, name = "p_agreement_id", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_success_o", type = Integer.class),
@StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_error_message_o", type = String.class)
},
resultSetMappings = "procedure_result_mapping")
@SqlResultSetMapping(name = "procedure_result_mapping", classes = {
@ConstructorResult(targetClass = ProcedureResult.class, columns = {
@ColumnResult(name = "p_success_o", type = Integer.class),
@ColumnResult(name = "p_error_message_o", type = String.class)
})
}
}}

The stored procedure is executed and produces a Map of the two output parameters. Then SQLQueryReturnProcessor.processReturn is called, which calls processConstructorReturn. But this method is empty, so the SqlResultSetMapping has no effect, and the Map is returned as the query result.

Is this by design, or is the functionality just missing?

Activity

Show:
Adrian Riley
updated the DescriptionJuly 31, 2020 at 8:49 AM
I am trying to call a stored procedure with 2 OUT parameters. I have declared a NamedStoredProcedureQuery referencing a SqlResultSetMapping: {{ @NamedStoredProcedureQuery(name = "set_case_handler", procedureName = "API_CUSTOMER_AGREEMENT_PKG.set_case_handler", parameters = { @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_agreement_id", type = String.class), @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_success_o", type = Integer.class), @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_error_message_o", type = String.class) }, resultSetMappings = "procedure_result_mapping") @SqlResultSetMapping(name = "procedure_result_mapping", classes = { @ConstructorResult(targetClass = ProcedureResult.class, columns = { @ColumnResult(name = "p_success_o", type = Integer.class), @ColumnResult(name = "p_error_message_o", type = String.class) }) } }} The stored procedure is executed and produces a Map of the two output parameters. Then {{SQLQueryReturnProcessor.processReturn}} is called, which calls {{processConstructorReturn}}. But this method is empty, so the SqlResultSetMapping has no effect, and the Map is returned as the query result. Is this by design, or is the functionality just missing?
I am trying to call a stored procedure with 2 OUT parameters. I have declared a NamedStoredProcedureQuery referencing a SqlResultSetMapping: \{\{ @NamedStoredProcedureQuery(name = "set_handler", procedureName = "API_CUSTOMER_PKG.set_handler", parameters = \{ @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_agreement_id", type = String.class), @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_success_o", type = Integer.class), @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_error_message_o", type = String.class) }, resultSetMappings = "procedure_result_mapping") @SqlResultSetMapping(name = "procedure_result_mapping", classes = \{ @ConstructorResult(targetClass = ProcedureResult.class, columns = \{ @ColumnResult(name = "p_success_o", type = Integer.class), @ColumnResult(name = "p_error_message_o", type = String.class) }) } }} The stored procedure is executed and produces a Map of the two output parameters. Then {{SQLQueryReturnProcessor.processReturn}} is called, which calls {{processConstructorReturn}}. But this method is empty, so the SqlResultSetMapping has no effect, and the Map is returned as the query result. Is this by design, or is the functionality just missing?
Adrian Riley
created the IssueJuly 31, 2020 at 7:55 AM

Details

Assignee

Reporter

Components

Affects versions

Priority

Created July 31, 2020 at 7:55 AM
Updated July 31, 2020 at 8:49 AM