[Seasar-user:18717] Re: DBFluteにおけるPagingの件数取得について
[E-MAIL ADDRESS DELETED]
[E-MAIL ADDRESS DELETED]
2009年 10月 21日 (水) 16:08:04 JST
$B5WJ]$5$^(B
$B!!$*@$OC$K$J$C$F$*$j$^$9(B.$B>>86$G$9(B.
$BEY!9?=$7Lu$4$6$$$^$;$s(B.$B$3$A$i$G8!F$$7$?$H$3$m!$(B
$B5WJ]$5$^$N$4Ds<(0F$,0lHV8zN(E*$HJ,$+$j$^$7$?!%(B
$[E-MAIL ADDRESS DELETED]$N%a!<%kBgJQ?=$7Lu$4$6$$$^$;$s(B.$BGK4~$7$F2<$5$$(B.
$B$3$A$i$NG'<1$O0J2<$NDL$j$G$9(B.
// $[E-MAIL ADDRESS DELETED]$:$O(B,$B#1#0#07o$r%;%C%H(B
pmb.checkSafetyResult(100);
try {
xxxBhv.outsideSql().manualPaging().selectPage(...);
// $B#1#0#07o0JFb$N$J$G!$"((B $B7k2L(B, Count(*)$B$H%G!<%?<hF@$N#22s$N(BSQL$B$,<B9T(B
} catch (DangerousResultSizeException e) {
$B!!!!(B// $B%(%i!<$H$J$C$?$N$G(B, $B"((B Count(*)$B$N#12s$N$_$,<B9T$5$l$F$$$k(B
// $B0J2<$N<[E-MAIL ADDRESS DELETED]?t$+$i%o!<%K%s%0$[E-MAIL ADDRESS DELETED]$($k(B
$B%a%C%;!<%8=PNO(B
// $B%f!<%6$,I=<($H$7$?>l9g(B
if (e.getActualResultSize() > 10000) {
// $B#9#9#97o0JFb(B
xxxBhv.outsideSql().selectList();
// $B7k2L!$"((B Count(*)$B!_#22s$H%G!<%?<hF@$N#12s$N(BSQL$B$,<B9T(B
} else {
// $B#1#0#0#0#07o0J>e(B
pmb.fetchFirst(10000);
xxxBhv.outsideSql().autoPaging().selectPage
// $B7k2L!$"((B Count(*)$B!_#22s$H%G!<%?<hF@$N#12s$N(BSQL$B$,<B9T(B
}
$B$H$$$&7k2L$H$J$j(B,$B0lHV8zN(E*$G$"$j!J(B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$K;H$$>!<j$,NI$5$=$&$J$N$G(B,$BK\=hM}8~$-$G$O$"$j$^$;$s$,(B,
>$BDI2C$7$FD:$1$k$N$G$"$l$P(B,$BBgJQM-Fq$$5!G=$G$9(B.
>$B%o!<%K%s%0-!$,$J$$=hM}$NJ}$,0lHLE*$H;W$$$^$9$7(B,$BK\%7%9%F%`$G$b;HMQ$9$k$3$H$K$J$k$+$b$7$l$^$;$s!%(B
>
>$B$b$7(B,$B2DG=$G$"$l$P(B,$B$4Ds<(5!G=$N8!F$$r$*4j$$$7$?$$$G$9(B.
>
>
>$B0x$_$K(B
>> Integer actualSize = e.getActualResultSize(); // $B$3$lI,MW$+$J!)!)!)(B
>$B$O(B,$B;d$K$H$C$F(B,$B$H$F$bI,MW$H;W$$$^$7$?(B.
>
>$B0J>e$G$9(B.
>
>>$B5WJ](B(jflute)$B$G$9!#(B
>>
>>$B>>86$5$s!"0lMwI=<($N;vA07o?t%A%'%C%/$H$$$&$3$H$G$9$,!"(B
>>$B$b$7!"$3$N$h$&$J5!G=$,$"$C$?$iMW7o$OK~$?$;$^$9$G$7$g$&!)(B
>>
>>XxxPmb pmb = new XxxPmb();
>>pmb.checkSafetyResult(10000); // $B0lK|7oD6$($A$c%@%a(B
>>try {
>> xxxBhv.outsideSql().manualPaging().selectPage(...);
>>} catch (DangerousResultSizeException e) {
>> int safetySize = e.getSafetyMaxResultSize();
>> Integer actualSize = e.getActualResultSize(); // $B$3$lI,MW$+$J!)!)!)(B
>> // $B0lK|7oD6$($?;~$N=hM}(B
>>}
>>$B"(L5O@!"<B8=$9$k$J$iF1MM$N5!G=$r(BConditionBean$B$K$b(B
>>
>>
>>$B4{$K(BConditionBean$B$G$O;w$?$h$&$JH/A[$N5!G=$,$"$C$F!"(B
>>$B$=$l$r%Z!<%8%s%0$N7o?t<hF@$K$bH?1G$5$;$k$N$O6Z$,(B
>>$BDL$C$F$k$+$J$H;W$$$^$7$F!#(B
>>
>>cb.checkSafetyResult(100);
>>xxxBhv.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$$G$7$g$&$+!)(B
>>>>>
>>>>> $B!&(BDBFlute$B$N<+F0:[E-MAIL ADDRESS DELETED]%P%C%A8e$KBP>]%/%i%9$N3HD%$O(B,$B:F:[E-MAIL ADDRESS DELETED]$N$?$S$KI,MW$H$J$k$?$a(B,
>>>>> DBFlute$B$N<+F0:[E-MAIL ADDRESS DELETED]$NCf$KAH$_9~$a$J$$$+(B,$B0J2<$N!V(BBsParameterBean.vm$B!W$K(B
>>>>> $B:#2s$N=hM}$r5-=R$7$F$_$^$7$?(B.
>>>>>
>>>>>
>>>>> $B!V(BBsParameterBean.vm$B!W$K!V(BCustomize Attribute$B!W$H!V(BCustomize Accessor$B!W$rDI2C(B.
>>>>>
>>>>> ***********************************************************
>>>>> ${database.allClassCopyright}package ${glPackageBaseParameterBean};
>>>>> #set ($myClassName = "${myBaseParameterBeanClassName}")
>>>>>
>>>>> #if ($database.isPmbMetaDataForProcedure($pmbClassName))
>>>>>
>>>>> $B!J>JN,!K(B
>>>>> // ===================================================================================
>>>>> // Customize Attribute
>>>>> // ====================
>>>>> protected boolean countOnly;
>>>>>
>>>>> // ===================================================================================
>>>>> // Attribute
>>>>> // =========
>>>>>
>>>>> $B!J>JN,!K(B
>>>>>
>>>>> // ===================================================================================
>>>>> // Customize Accessor
>>>>> // ==================
>>>>> #if ($database.getPmbMetaDataSuperClassDefinition($pmbClassName).indexOf("SimplePagingBean") > 0)
>>>>> public boolean isCountOnly() {
>>>>> return countOnly;
>>>>> }
>>>>>
>>>>> public void setCountOnly(boolean countOnly) {
>>>>> this.countOnly = countOnly;
>>>>> }
>>>>>
>>>>> @Override
>>>>> public boolean isPaging() {
>>>>> return super.isPaging() && isCountOnly();
>>>>> }
>>>>> #end
>>>>>
>>>>> // ===================================================================================
>>>>> // Accessor
>>>>> // ========
>>>>>
>>>>> ***********************************************************
>>>>>
>>>>>
>>>>> $B8+?I$/$J$j$^$7$?$,(B,DBFlute$B$N<+F0:[E-MAIL ADDRESS DELETED]%P%C%A$K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>>>>>$B!!!!!!!V(BoutsideSql().autoPaging().selectPage$B!W$r8F=P$9(B
>>>>>>>>$B$@$H!"ITMW$J%Z!<%8%s%0<B%G!<%?$,0l7o$H$O$$$(<hF@$7$F$7$^$$$^$9!#(B
>>>>>>>>
>>>>>>>>$B!J#2!K(B Select Count(*) $B$N$_$N30$@$7(BSQL$B$rJLES:[E-MAIL ADDRESS DELETED]$9$k(B
>>>>>>>>$B$@$H!"(BWhere$B6g$,>iD9$7$F$7$^$$$^$9!#(B
>>>>>>>>
>>>>>>>>$B!c(BA$B!d(B
>>>>>>>>pmb.xsetPaging(false)$B$G3N$+$K(BisPaging()$B$,(Bfalse$B$K$J$j$^$9$,!"(B
>>>>>>>>$B!V(Bx$B!W$G;O$^$k%a%=%C%I$O6KNO%"%W%j%1!<%7%g%s$GD>@\MxMQ$7$F(B
>>>>>>>>$BM_$7$/$J$$%a%=%C%I$G$O$"$j$^$9!#[E-MAIL ADDRESS DELETED]$NJ]>Z$O$J$/!"(B
>>>>>>>>$B$"$k$H$-$K%a%=%C%IL>$,JQ$o$C$F$7$^$&2DG=@-$b$"$j$^$9!#(B
>>>>>>>>
>>>>>>>>$B$J$N$G$=$l$h$j$O!"0J2<$N$h$&$KL@<(E*$J%/%i%9$r:[E-MAIL ADDRESS DELETED]$7$F!"(B
>>>>>>>>$BMxMQ$9$kJ}$,%W%m%0%i%`$[E-MAIL ADDRESS DELETED]$H$7$F$bNI$$$+$J$H;W$$$^$9!#(B
>>>>>>>>($BL5L>%$%s%J!<%/%i%9$G$d$k$H(BIllegalAccess$B$K$J$C$F$7$^$$$^$7$?(B...)
>>>>>>>>
>>>>>>>>public static class CountOnlyXxxPmb extends XxxPmb {
>>>>>>>> public boolean isPaging() {
>>>>>>>> return false;
>>>>>>>> }
>>>>>>>>}
>>>>>>>>
>>>>>>>>$B!c(BB$B!d(B
>>>>>>>>$B$b$&0l$D$O!"(BXxxPmb$B$K?7$?$K(B[boolean countOnly]$B$H$$$&$h$&$J(B
>>>>>>>>$B%W%m%Q%F%#$rDI2C$7$F!"(BisPaging()$B$H0l=o$KH=Dj$5$;$F$"$2$k$h$&$K(B
>>>>>>>>$B$9$k$N$bNI$$$+$H;W$$$^$9!#(B
>>>>>>>>
>>>>>>>>$B%Q%i%a!<%?%3%a%s%H$K$F(BisPaging()$B$HI,$:0l=o$KH=Dj!'(B
>>>>>>>>/*IF pmb.isPaging() && !pmb.isCountOnly()*/
>>>>>>>>/*END*/
>>>>>>>>
>>>>>>>>$B$b$7$/$O(B
>>>>>>>>
>>>>>>>>ExParameterBean$B$G(BisPaging()$B$r%*!<%P!<%i%$%I$7$F0l=o$KH=Dj!'(B
>>>>>>>>public class XxxPmb extends BsXxxPmb {
>>>>>>>> public boolean isPaging() {
>>>>>>>> return super.isPaging() && !isCountOnly();
>>>>>>>> }
>>>>>>>>}
>>>>>>>>
>>>>>>>>$B8e<T$NJ}$,C1BN%F%9%H$G%F%9%H$b$7$d$9$/%?%$%W%;!<%U$G$9$M!#(B
>>>>>>>>$B$=$7$F!"%"%W%j%1!<%7%g%s$G$N8F$S=P$7$K$F0J2<$N$h$&$K!'(B
>>>>>>>>XxxPmb pmb = new XxxPmb();
>>>>>>>>pmb.setCountOnly(true);
>>>>>>>>int count = bhv.outsideSql().entityHandling().selectEntity(...);
>>>>>>>>
>>>>>>>>
>>>>>>>>#
>>>>>>>># $B%]%$%s%H$J$N$O!"(BDBFlute$B$bC1$K(B2WaySQL$B$N;EAH$_$N(B
>>>>>>>># $BHOaF$GJXMx$J5!G=$r:n$C$F$$$k$@$1$C$F$H$3$m$G$9$M!#(B
>>>>>>>># $B$J$N$G!"(B2WaySQL$B$N;EAH$_$rMxMQ$9$k$3$H$G%"%l%s%82DG=$G$9!#(B
>>>>>>>>#
>>>>>>>>
>>>>>>>>2009/10/20 <[E-MAIL ADDRESS DELETED]>:
>>>>>>>>> $B5WJ]$5$^(B
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> $B$*@$OC$K$J$C$F$*$j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$7(BSQL$B$G$N%Z!<%8%s%08!:w$O!"(B
>>>>>>>>>>http://dbflute.sandbox.seasar.org/contents/outside-sql/paging.html
>>>>>>>>>>$B$3$N$h$&$J46$8$K$J$j$^$9!#(B
>>>>>>>>>>
>>>>>>>>>>PagingResultBean<UnpaidSummaryMember> page
>>>>>>>>>> = memberBhv.outsideSql().autoPaging().selectPage(path, pmb, entityType);
>>>>>>>>>>
>>>>>>>>>>int allRecordCount = page.getAllRecordCount(); // $B%Z!<%8%s%0$J$77o?t(B
>>>>>>>>>>for (UnpaidSummaryMember member : page) { // $B%Z!<%8%s%0<B%G!<%?(B
>>>>>>>>>>}
>>>>>>>>>>
>>>>>>>>> $B"M(B $B$3$N>l9g(B,$B7k2L$H$7$F7o?t$@$1$G$J$/(BSELECT$B6g$NA4%+%i%`$b<hF@$7$F$$$k$HG'<1$7$F$$$^$7$?$,(B,
>>>>>>>>> $B0J2<$N!V(Bpmb.isPaging()$B!W$r(Bfalse$B$H$J$k$h$&$K<B9T$9$l$P!"7o?t$N$_$,<hF@$G$-$k$H>!<j(B
>>>>>>>>> $B$K21B,$7$?<!Bh$G$7$?!#(B
>>>>>>>>>
>>>>>>>>> $B$G$O!"(BSQL$B$N<B9TB.EY5Z$S%G!<%?E>AwNL$r:G>.8B$KM^$($F(B,$B30$@$7(BSQL$B$N7o?t<hF@$r9T$&>l9g(B,
>>>>>>>>> $B!J#1!K(B $B%Z!<%8%s%0$G<hF@$9$k7o?t$r#17o$[E-MAIL ADDRESS DELETED]$7$F!V(BoutsideSql().autoPaging().selectPage$B!W(B
>>>>>>>>> $B$r8F=P$9(B
>>>>>>>>> $B!J#2!K(B Select Count(*) $B$N$_$N30$@$7(BSQL$B$rJLES:[E-MAIL ADDRESS DELETED]$9$k(B
>>>>>>>>> $B$N#2DL$j$G<BAu$9$k$N$,K>$^$7$$$H$$$&$3$H$G$7$g$&$+!)(B
>>>>>>>>>
>>>>>>>>> $B$^$?(B,$B!V(BParameterBean#xsetPaging(false);$B!W$G0l1~(B,$B7o?t<hF@$,$G$-$F$$$k$K8+$($^$7$?$,(B,
>>>>>>>>> $B;HMQ$7$F$O$$$1$J$$$HG'<1$7$F$h$m$7$$$G$7$g$&$+!)(B
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /*IF pmb.isPaging()*/
>>>>>>>>> select member.MEMBER_ID
>>>>>>>>> , member.MEMBER_NAME
>>>>>>>>> , ...
>>>>>>>>> -- ELSE select count(*)
>>>>>>>>> /*END*/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> $B0J>e$G$9(B.$B59$7$/$*4j$$CW$7$^$9!%(B
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>2009/10/20 <[E-MAIL ADDRESS DELETED]>:
>>>>>>>>>>>
>>>>>>>>>>> $B$*@$OC$K$J$C$F$*$j$^$9!%>>86$G$9!%(B
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> $B7GBj$N7o(B,$B<BAuJ}K!$,%5%$%H$+$i8+=P$9$3$H$,$G$-$:(B,
>>>>>>>>>>> $B=iJbE*$J<ALd$H$O(B,$B;W$$$^$9$,(B,Paging$B5!G=$r;HMQ$7$F(B,
>>>>>>>>>>> $B7o?t$r<hF@$7$?$$>l9g(B,$B0J2<$N;HMQJ}K!$GLdBj$J$$$+(B
>>>>>>>>>>> $B$465<(D:$1$J$$$G$7$g$&$+!)(B
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ===============================================
>>>>>>>>>>> $B!c%5%$%H$NNc!d(B
>>>>>>>>>>> /*IF pmb.isPaging()*/
>>>>>>>>>>> select member.MEMBER_ID
>>>>>>>>>>> , member.MEMBER_NAME
>>>>>>>>>>> , ...
>>>>>>>>>>> -- ELSE select count(*)
>>>>>>>>>>> /*END*/
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> $B!c;HMQ;~$N2r<a!d(B
>>>>>>>>>>> // Parameter$B$[E-MAIL ADDRESS DELETED](B
>>>>>>>>>>> final prm = new XxxPmb();
>>>>>>>>>>> prm.setName("'$B%F%9%H(B'");
>>>>>>>>>>>
>>>>>>>>>>> prm.xsetPaging(false); // $B"+(B (1)$B$3$N%a%=%C%I$G(BPaging$B$r(BOFF$B!)(B
>>>>>>>>>>>
>>>>>>>>>>> int cnt = XxxBhv.outsideSql.entityHandling.selectEntity(XxxBhv.PATH_select, prm, Integer.class);
>>>>>>>>>>>
>>>>>>>>>>> System.out.println(cnts); // $B"+(B (2)$B$3$N7k2L$K7o?t$,F~$C$F$$$k!)(B
>>>>>>>>>>>
>>>>>>>>>>> ===============================================
>>>>>>>>>>>
>>>>>>>>>>> (1)$B$H(B(2)$B$N;H$$J}$[E-MAIL ADDRESS DELETED]$7$$$+(B,$B$43NG'$NDx(B,$B59$7$/$*4j$$$7$^$9(B.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> $B0J>e!%(B
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Seasar-user mailing list
>>>>>>>>>>> [E-MAIL ADDRESS DELETED]
>>>>>>>>>>> https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>>>>>>>
>>>>>>>>>>_______________________________________________
>>>>>>>>>>Seasar-user mailing list
>>>>>>>>>>[E-MAIL ADDRESS DELETED]
>>>>>>>>>>https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Seasar-user mailing list
>>>>>>>>> [E-MAIL ADDRESS DELETED]
>>>>>>>>> https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>>>>>
>>>>>>>>>
>>>>>>>>_______________________________________________
>>>>>>>>Seasar-user mailing list
>>>>>>>>[E-MAIL ADDRESS DELETED]
>>>>>>>>https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Seasar-user mailing list
>>>>>>> [E-MAIL ADDRESS DELETED]
>>>>>>> https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>>>
>>>>>>>
>>>>>>_______________________________________________
>>>>>>Seasar-user mailing list
>>>>>>[E-MAIL ADDRESS DELETED]
>>>>>>https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Seasar-user mailing list
>>>>> [E-MAIL ADDRESS DELETED]
>>>>> https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>>
>>>>>
>>>>_______________________________________________
>>>>Seasar-user mailing list
>>>>[E-MAIL ADDRESS DELETED]
>>>>https://ml.seasar.org/mailman/listinfo/seasar-user
>>>>
>>>
>>> _______________________________________________
>>> Seasar-user mailing list
>>> [E-MAIL ADDRESS DELETED]
>>> https://ml.seasar.org/mailman/listinfo/seasar-user
>>>
>>>
>>_______________________________________________
>>Seasar-user mailing list
>>[E-MAIL ADDRESS DELETED]
>>https://ml.seasar.org/mailman/listinfo/seasar-user
>>
>
Seasar-user メーリングリストの案内