try {
final String resultMapId = parameterMapping.getResultMapId();
final ResultMap resultMap = configuration.getResultMap(resultMapId);
final ResultSetWrapper rsw = new ResultSetWrapper(rs, configuration);
mappedStatement.getStatementLog().debug("Fetching output ref cursor");
if (resultHandler == null) {
final DefaultResultHandler resultHandler = new DefaultResultHandler(objectFactory);
handleRowValues(rsw, resultMap, resultHandler, new RowBounds(), null);
metaParam.setValue(parameterMapping.getProperty(), resultHandler.getResultList());
} else {
handleRowValues(rsw, resultMap, this.resultHandler, new RowBounds(), null);
}
} finally {@Select("{ CALL getOrders(#{customerId}, "
+ "#{resultContainer.returnCode, mode=OUT, jdbcType=INTEGER}, "
+ "#{resultContainer.returnMessage, mode=OUT, jdbcType=VARCHAR}, "
+ "#{resultContainer.resultList, mode=OUT, jdbcType=CURSOR, javaType=java.sql.ResultSet, resultMap=orderResultMap}"
+ ") }")
@ResultMap("orderResultMap")
@Options(statementType = StatementType.CALLABLE)
void getOrders(@Param("customerId") Integer customerId, @Param("resultContainer") ResultContainer<OrderDto> resultContainer, ResultHandler<OrderDto> resultHandler);mapper.getOrdersWithRH(14383, resultContainer, new OrderResultHandler());git push --set-upstream origin feature/callable_statement_handling
remote: Permission to mybatis/mybatis-3.git denied to blackwizard1812.
fatal: unable to access 'https://github.com/mybatis/mybatis-3.git/': The requested URL returned error: 403--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public enum UseCustomHandlerOnRefCursorOutputParameter {
/**
* Default value, provided result handler is ignored.
*/
NONE,
/**
* Provided result handler is used on each of statement RefCursor output parameter.
*/
ALL,
/**
* Provided result handler is used on first of statement RefCursor output parameter.
* DefaultResultHandler is used for all other cursors.
*/
FIRST,
/**
* Provided result handler is used on first of statement RefCursor output parameter
* if there is only one, otherwise DefaultResultHandler is used for all cursors.
*/
IF_ONLY_ONE_CURSOR;
}Hi Erwan,
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.
Hi Erwan,
I have committed the fix that works with a stored procedure with a single refcursor out parameter.
Could you verify the fix with the latest 3.4.6-SNAPSHOT ?
https://github.com/mybatis/mybatis-3/wiki/Maven
Regarding a stored procedure that has multiple refcursor out parameters, I have a fix, but didn’t like it very much, so I’ll reconsider it when/if someone actually needs it (my fix won’t break existing solutions).
And even with the current implementation, checking the instance type could be used as a workaround, I guess.
Object obj = resultContext.getObject();
if (obj instanceof Person) {
// ...
} else if (obj instanceof Pet) {
// ...
Regards,
Iwao
final ResultSetWrapper rsw = new ResultSetWrapper(rs, configuration);To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.
CREATE OR REPLACE FUNCTION mbtest.get_order_out_params_with_null_cursor(
order_number integer,
detail_count out integer,
header_curs out refcursor
) AS $BODY$
BEGIN
select count(*) into detail_count from mbtest.order_detail where order_id = ORDER_NUMBER;
END;
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.