Search in sources :

Example 1 with TnFetchAssistResultSet

use of org.dbflute.s2dao.jdbc.TnFetchAssistResultSet in project dbflute-core by dbflute.

the class TnBasicSelectHandler method doQueryResult.

protected ResultSet doQueryResult(PreparedStatement ps) throws SQLException {
    // /- - - - - - - - - - - - - - - - - - - - - - - - - - -
    // All select statements on DBFlute use this result set.
    // - - - - - - - - - -/
    final ResultSet rs = executeQuery(ps);
    if (!isUseFunctionalResultSet()) {
        return rs;
    }
    if (isInternalDebugEnabled()) {
        _log.debug("...Wrapping result set by functional one");
    }
    final FetchBean selbean = FetchAssistContext.getFetchBeanOnThread();
    final TnFetchAssistResultSet wrapper;
    if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) {
        final OutsideSqlContext context = OutsideSqlContext.getOutsideSqlContextOnThread();
        final boolean offsetByCursorForcedly = context.isOffsetByCursorForcedly();
        final boolean limitByCursorForcedly = context.isLimitByCursorForcedly();
        wrapper = createFunctionalResultSet(rs, selbean, offsetByCursorForcedly, limitByCursorForcedly);
    } else {
        wrapper = createFunctionalResultSet(rs, selbean, false, false);
    }
    return wrapper;
}
Also used : FetchBean(org.dbflute.jdbc.FetchBean) OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext) ResultSet(java.sql.ResultSet) TnFetchAssistResultSet(org.dbflute.s2dao.jdbc.TnFetchAssistResultSet) TnFetchAssistResultSet(org.dbflute.s2dao.jdbc.TnFetchAssistResultSet)

Example 2 with TnFetchAssistResultSet

use of org.dbflute.s2dao.jdbc.TnFetchAssistResultSet in project dbflute-core by dbflute.

the class TnProcedureHandler method wrapResultSetIfNeeds.

protected ResultSet wrapResultSetIfNeeds(Object pmb, ResultSet rs) {
    if (pmb instanceof FetchBean) {
        final FetchBean fcbean = (FetchBean) pmb;
        final int safetyMaxResultSize = fcbean.getSafetyMaxResultSize();
        if (safetyMaxResultSize > 0) {
            // wrap for check safety
            return new TnFetchAssistResultSet(rs, fcbean, false, false);
        }
    }
    return rs;
}
Also used : FetchBean(org.dbflute.jdbc.FetchBean) TnFetchAssistResultSet(org.dbflute.s2dao.jdbc.TnFetchAssistResultSet)

Aggregations

FetchBean (org.dbflute.jdbc.FetchBean)2 TnFetchAssistResultSet (org.dbflute.s2dao.jdbc.TnFetchAssistResultSet)2 ResultSet (java.sql.ResultSet)1 OutsideSqlContext (org.dbflute.outsidesql.OutsideSqlContext)1