BEHAVIOR - The type of behavior.public class OutsideSqlAutoPagingExecutor<BEHAVIOR> extends AbstractOutsideSqlPagingExecutor<BEHAVIOR>
_behaviorCommandInvoker, _currentDBDef, _outsideSqlExecutorFactory, _outsideSqlOption, _tableDbName| コンストラクタと説明 |
|---|
OutsideSqlAutoPagingExecutor(BehaviorCommandInvoker behaviorCommandInvoker,
String tableDbName,
DBDef currentDBDef,
OutsideSqlOption outsideSqlOption,
OutsideSqlExecutorFactory outsideSqlExecutorFactory) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
OutsideSqlAutoPagingExecutor<BEHAVIOR> |
configure(StatementConfig statementConfig)
Configure statement JDBC options.
|
OutsideSqlAutoPagingExecutor<BEHAVIOR> |
formatSql()
Set up format-SQL for this outside-SQL.
|
OutsideSqlAutoPagingExecutor<BEHAVIOR> |
removeBlockComment()
Set up remove-block-comment for this outside-SQL.
|
OutsideSqlAutoPagingExecutor<BEHAVIOR> |
removeLineComment()
Set up remove-line-comment for this outside-SQL.
|
<ENTITY> ListResultBean<ENTITY> |
selectList(AutoPagingHandlingPmb<BEHAVIOR,ENTITY> pmb)
Select list with paging by the outside-SQL.
|
<ENTITY> PagingResultBean<ENTITY> |
selectPage(AutoPagingHandlingPmb<BEHAVIOR,ENTITY> pmb)
Select page by the outside-SQL.
|
createBasicExecutor, createBhvExThrower, createCountExecutor, createPagingHandler, createPagingInvoker, doSelectList, doSelectPage, selectList, selectPage, setupScrollableCursorIfNeeds, throwPagingCountSelectNotCountExceptionpublic OutsideSqlAutoPagingExecutor(BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName, DBDef currentDBDef, OutsideSqlOption outsideSqlOption, OutsideSqlExecutorFactory outsideSqlExecutorFactory)
public <ENTITY> PagingResultBean<ENTITY> selectPage(AutoPagingHandlingPmb<BEHAVIOR,ENTITY> pmb)
SimpleMemberPmb pmb = new SimpleMemberPmb();
pmb.setMemberName_PrefixSearch("S");
pmb.paging(20, 3); // 20 records per a page and current page number is 3
PagingResultBean<SimpleMember> page
= memberBhv.outsideSql().manualPaging().selectPage(pmb);
int allRecordCount = page.getAllRecordCount();
int allPageCount = page.getAllPageCount();
boolean isExistPrePage = page.isExistPrePage();
boolean isExistNextPage = page.isExistNextPage();
...
for (SimpleMember member : page) {
... = member.get...();
}
The parameter-bean needs to extend SimplePagingBean.
The way to generate it is following:
-- !df:pmb extends SPB! -- !!Integer memberId!! -- !!...!!You can realize by pagingBean's isPaging() method on your 'Parameter Comment'. It returns false when it executes Count. And it returns true when it executes Paging.
e.g. ManualPaging and MySQL /*IF pmb.isPaging()*/ select member.MEMBER_ID , member.MEMBER_NAME , memberStatus.MEMBER_STATUS_NAME -- ELSE select count(*) /*END*/ from MEMBER member /*IF pmb.isPaging()*/ left outer join MEMBER_STATUS memberStatus on member.MEMBER_STATUS_CODE = memberStatus.MEMBER_STATUS_CODE /*END*/ /*BEGIN*/ where /*IF pmb.memberId != null*/ member.MEMBER_ID = /*pmb.memberId*/'123' /*END*/ /*IF pmb.memberName != null*/ and member.MEMBER_NAME like /*pmb.memberName*/'Billy%' /*END*/ /*END*/ /*IF pmb.isPaging()*/ order by member.UPDATE_DATETIME desc /*END*/ /*IF pmb.isPaging()*/ limit /*$pmb.pageStartIndex*/80, /*$pmb.fetchSize*/20 /*END*/
ENTITY - The type of entity.pmb - The typed parameter-bean for auto-paging handling. (NotNull)OutsideSqlNotFoundException - When the outside-SQL is not found.DangerousResultSizeException - When the result size is over the specified safety size.public <ENTITY> ListResultBean<ENTITY> selectList(AutoPagingHandlingPmb<BEHAVIOR,ENTITY> pmb)
SimpleMemberPmb pmb = new SimpleMemberPmb();
pmb.setMemberName_PrefixSearch("S");
pmb.paging(20, 3); // 20 records per a page and current page number is 3
ListResultBean<SimpleMember> memberList
= memberBhv.outsideSql().manualPaging().selectList(pmb);
for (SimpleMember member : memberList) {
... = member.get...();
}
The parameter-bean needs to extend SimplePagingBean.
The way to generate it is following:
-- !df:pmb extends SPB! -- !!Integer memberId!! -- !!...!!You don't need to use pagingBean's isPaging() method on your 'Parameter Comment'.
e.g. ManualPaging and MySQL
select member.MEMBER_ID
, member.MEMBER_NAME
, memberStatus.MEMBER_STATUS_NAME
from MEMBER member
left outer join MEMBER_STATUS memberStatus
on member.MEMBER_STATUS_CODE = memberStatus.MEMBER_STATUS_CODE
/*BEGIN*/
where
/*IF pmb.memberId != null*/
member.MEMBER_ID = /*pmb.memberId*/'123'
/*END*/
/*IF pmb.memberName != null*/
and member.MEMBER_NAME like /*pmb.memberName*/'Billy%'
/*END*/
/*END*/
order by member.UPDATE_DATETIME desc
limit /*$pmb.pageStartIndex*/80, /*$pmb.fetchSize*/20
ENTITY - The type of entity.pmb - The typed parameter-bean for auto-paging handling. (NotNull)OutsideSqlNotFoundException - When the outside-SQL is not found.DangerousResultSizeException - When the result size is over the specified safety size.public OutsideSqlAutoPagingExecutor<BEHAVIOR> removeBlockComment()
removeBlockComment クラス内 AbstractOutsideSqlPagingExecutor<BEHAVIOR>public OutsideSqlAutoPagingExecutor<BEHAVIOR> removeLineComment()
removeLineComment クラス内 AbstractOutsideSqlPagingExecutor<BEHAVIOR>public OutsideSqlAutoPagingExecutor<BEHAVIOR> formatSql()
formatSql クラス内 AbstractOutsideSqlPagingExecutor<BEHAVIOR>public OutsideSqlAutoPagingExecutor<BEHAVIOR> configure(StatementConfig statementConfig)
configure クラス内 AbstractOutsideSqlPagingExecutor<BEHAVIOR>statementConfig - The configuration of statement. (NullAllowed)Copyright © 2014–2015 The DBFlute Project. All rights reserved.