use of org.dbflute.cbean.paging.FetchNarrowingBean in project dbflute-core by dbflute.
the class TnBasicSelectHandler method isUseFunctionalResultSet.
protected boolean isUseFunctionalResultSet() {
// for safety result
final FetchBean fcbean = FetchAssistContext.getFetchBeanOnThread();
if (fcbean != null && fcbean.getSafetyMaxResultSize() > 0) {
// priority one
return true;
}
final FetchNarrowingBean fnbean = FetchAssistContext.getFetchNarrowingBeanOnThread();
if (fnbean != null && fnbean.isFetchNarrowingEffective()) {
// for unsupported paging (ConditionBean)
if (fnbean.isFetchNarrowingSkipStartIndexEffective() || fnbean.isFetchNarrowingLoopCountEffective()) {
// priority two
return true;
}
// for auto paging (OutsideSql)
if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) {
final OutsideSqlContext outsideSqlContext = OutsideSqlContext.getOutsideSqlContextOnThread();
if (outsideSqlContext.isOffsetByCursorForcedly() || outsideSqlContext.isLimitByCursorForcedly()) {
// priority three
return true;
}
}
}
return false;
}
use of org.dbflute.cbean.paging.FetchNarrowingBean in project dbflute-core by dbflute.
the class BehaviorCommandInvoker method closeContext.
protected void closeContext() {
if (FetchAssistContext.isExistFetchNarrowingBeanOnThread()) {
// /- - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Because there is possible that fetch narrowing has been
// ignored for manualPaging of outsideSql.
// - - - - - - - - - -/
final FetchNarrowingBean fnbean = FetchAssistContext.getFetchNarrowingBeanOnThread();
fnbean.xenableIgnoredFetchNarrowing();
}
clearAllCurrentContext();
restoreAllContextOnThreadIfExists();
}
Aggregations