Search in sources :

Example 1 with TnProcedureHandler

use of org.dbflute.s2dao.sqlhandler.TnProcedureHandler in project dbflute-core by dbflute.

the class TnProcedureCommand method createProcedureHandler.

protected TnProcedureHandler createProcedureHandler(Object pmb) {
    final String sql = filterExecutedSql(buildSql(pmb));
    TnProcedureResultSetHandlerProvider provider = createProcedureResultSetHandlerProvider();
    return new TnProcedureHandler(_dataSource, _statementFactory, sql, _procedureMetaData, provider);
}
Also used : TnProcedureResultSetHandlerProvider(org.dbflute.s2dao.sqlhandler.TnProcedureHandler.TnProcedureResultSetHandlerProvider) TnProcedureHandler(org.dbflute.s2dao.sqlhandler.TnProcedureHandler)

Example 2 with TnProcedureHandler

use of org.dbflute.s2dao.sqlhandler.TnProcedureHandler in project dbflute-core by dbflute.

the class TnProcedureCommand method execute.

// ===================================================================================
// Execute
// =======
public Object execute(final Object[] args) {
    // the args is unused because of getting from context
    // (actually the args has same parameter as context)
    final OutsideSqlContext outsideSqlContext = OutsideSqlContext.getOutsideSqlContextOnThread();
    // basically implements ProcedurePmb
    final Object pmb = outsideSqlContext.getParameterBean();
    final TnProcedureHandler handler = createProcedureHandler(pmb);
    final Object[] onlyPmbArgs = new Object[] { pmb };
    // The method that builds display SQL is overridden for procedure
    // so it can set arguments which have only parameter bean
    handler.setExceptionMessageSqlArgs(onlyPmbArgs);
    return handler.execute(onlyPmbArgs);
}
Also used : OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext) TnProcedureHandler(org.dbflute.s2dao.sqlhandler.TnProcedureHandler)

Aggregations

TnProcedureHandler (org.dbflute.s2dao.sqlhandler.TnProcedureHandler)2 OutsideSqlContext (org.dbflute.outsidesql.OutsideSqlContext)1 TnProcedureResultSetHandlerProvider (org.dbflute.s2dao.sqlhandler.TnProcedureHandler.TnProcedureResultSetHandlerProvider)1