Hibernate3 提供了DetachedCriteria,使得我们可以在Web层构造 /Y*WBTV'
S_iMVHe
detachedCriteria,然后调用业务层Bean,进行动态条件查询,根 ];} Wfl
Q;MT"=RW
据这一功能,我设计了通用的抽象Bean基类和分页类支持,代码来 t$+?6E
@M<|:Z %.@
自于Quake Wang的javaeye-core包的相应类,然后又做了很多修改 yTyj'-4
cO-7ke
。 l+3[ KCE
k=2Lo
分页支持类: =31"fS@
{.n"Z
java代码: +~St !QV%
2:*w~|6>}5
?J'Y&
package com.javaeye.common.util; a! (4Ch
v.\*./-i
import java.util.List; 6f;fx}y
3yANv?$a
publicclass PaginationSupport { -1Jg?cPzk
'#!
gh?
publicfinalstaticint PAGESIZE = 30; {Z{75}
TH)"wNa
privateint pageSize = PAGESIZE; cD@(/$wt
.=U#eHBdAQ
privateList items; -T!f,g3vW
~"dA~[r
L
privateint totalCount; 4p e'06:
_t:$XJ`bTk
privateint[] indexes = newint[0]; 6L:x^bM
J`^ag'
privateint startIndex = 0; 2C2fGYu
<DpevoF
public PaginationSupport(List items, int kTKq/G,Ft
Ytgcs(
/$
totalCount){ $r@
=*(
setPageSize(PAGESIZE); R[Ll59-
setTotalCount(totalCount); :#2Bw]z&z
setItems(items); eeIhed9
setStartIndex(0); /{|EAd{
} UsgK
\Fl+\?~D
public PaginationSupport(List items, int h"lX4
$GYm6x\4
totalCount, int startIndex){ ko1J094Y%
setPageSize(PAGESIZE); 0,r}o
setTotalCount(totalCount); tzZ63@cm
setItems(items); J5*tJoCYS
setStartIndex(startIndex); ckV`OaRw4
} oV)~@0B&0
avjpA?Vz
public PaginationSupport(List items, int 0WT{,/>
hhb?6]Z/
totalCount, int pageSize, int startIndex){ #btLa\HJ
setPageSize(pageSize); 0fc/wfv<
setTotalCount(totalCount); 0?sRDYaX;c
setItems(items); aHlcfh9|
setStartIndex(startIndex); nJbtS#`G4
} s~X+*@.
yphS'AG
publicList getItems(){ ^L0d/,ik
return items; )iq-yjO6
} j0Bu-sO$w
W8Q|$ZJ88F
publicvoid setItems(List items){
zG+R5:
this.items = items; yPM3a7-Bm
} ]FD'5p{
t'9*R7=
publicint getPageSize(){ u?>B)PW
return pageSize; N03G>fZ
} R,)}>X|<
?/TSi0R
publicvoid setPageSize(int pageSize){ -r#X~2tPzD
this.pageSize = pageSize; whonDG4WP
} @vpf[j
HfcL%b%G8
publicint getTotalCount(){ _C.BFE_p
return totalCount; m7&O9?X
} ANvR i+ _
b k|m4|
publicvoid setTotalCount(int totalCount){ .7zK@6i
if(totalCount > 0){ |M8WyW
this.totalCount = totalCount; A"`foI$0
int count = totalCount / w0|gG+x jS
79nG|Yj|\
pageSize; ~UyV<
if(totalCount % pageSize > 0) ktK_e
count++; ~CtL9m3tO
indexes = newint[count]; iY`%SmB
for(int i = 0; i < count; i++){ MWI4Y@1bS
indexes = pageSize * PpV'F[|,r
sBu=e7
i; VmCW6
G#M
} \Z^TXyu
}else{ .udv"?!z
this.totalCount = 0; i.=w]S
j
} iP@ZM=&wz
} wx\v:A
h8 'v d3
publicint[] getIndexes(){ x&^_c0fn
return indexes; tBNoI
} <F'X<Bau
RlheQTJ
publicvoid setIndexes(int[] indexes){ G+F#n6Vx
this.indexes = indexes; I96Ci2)m
} !h(|\"
}
\(VTt|}By$
publicint getStartIndex(){ I6j$X 6u
return startIndex; ,QC{3i~
} XGJj3-eW{
76wc ,+
publicvoid setStartIndex(int startIndex){ cUqke+!
if(totalCount <= 0) H_EB1"C;\
this.startIndex = 0; |?Frj
elseif(startIndex >= totalCount) (
xXGSx
this.startIndex = indexes 0ge$ p,
*\(r+>*x*
[indexes.length - 1]; -6Oz^
elseif(startIndex < 0) 6&DX] [G
this.startIndex = 0; i O/K nH
else{ 4Y,R-+f
this.startIndex = indexes {n/uh0>f*
;l&4V
[startIndex / pageSize]; 5~Cakd]>
} jx.[#6e
} U7doU' V/
Q?8R[i
publicint getNextIndex(){ ^
"i l}8`
int nextIndex = getStartIndex() + @o#!EfZyE
~ zil/P8
pageSize; RletL)
if(nextIndex >= totalCount) QYa(N[~a
return getStartIndex(); ?q(\=;Y
else &ZghMq~
return nextIndex; `6 /$M!4$
} XO-Prs
0VckocF
publicint getPreviousIndex(){ pWPIJ>2G:
int previousIndex = getStartIndex() - A,V\"KU
6An9S%:_
pageSize; TpmwD{c[\
if(previousIndex < 0) $={:r/R`i
return0; T21ky>8E
else +E1I");
return previousIndex; JT "B>y>
} Dq36p${\W
P&j(,7
} }"|"Q7H
e{X6i^%
m_
Dfps
gY)/?
u5 {JQO
抽象业务类 nB%;S
java代码: z\0CE]#T
tp6M=MC%
eh4gQ^l
/** 4l!@=qwn
* Created on 2005-7-12 ndjx|s)E
*/ 5Xl/L
package com.javaeye.common.business; NE/m-ILw
"Fy7K#n
import java.io.Serializable; 0O\SU"bP
import java.util.List; ZDD..j
{%VV\qaC
import org.hibernate.Criteria; [zL7Q^~
import org.hibernate.HibernateException; 6ZKsz5:=
import org.hibernate.Session; JJltPGT~Oa
import org.hibernate.criterion.DetachedCriteria; :(a]V"(&Eq
import org.hibernate.criterion.Projections; t~E<j+<2B
import !
iptT(2
e'*`.^
org.springframework.orm.hibernate3.HibernateCallback; yz-,)GB6
import &ISb~5
:Xn7Ha[f
org.springframework.orm.hibernate3.support.HibernateDaoS 1iX)d)(b
_*IPk
upport; "S&@F/
3m>+-})d
import com.javaeye.common.util.PaginationSupport; MZpK~c1`
aM@z^<Ub
public abstract class AbstractManager extends lqowG!3H
K,6b3kk
HibernateDaoSupport { N0K){
wO:Sg=,
privateboolean cacheQueries = false; )J_\tv
26dUA~|KJ
privateString queryCacheRegion; S@}1t4Ls:
"]m+z)lWd
publicvoid setCacheQueries(boolean ,bM-I2BR
ly4s"4v
cacheQueries){ kaxvPv1
this.cacheQueries = cacheQueries; ?;wpd';c
} }<>~sy
1VF
publicvoid setQueryCacheRegion(String ],ZzI
yf?h#G%24
queryCacheRegion){ -*~CV:2iq-
this.queryCacheRegion = N7b1.]<
:d0Y%vl
queryCacheRegion; /wxE1][.
} hY*0aZ|(
&n[~!%(
publicvoid save(finalObject entity){ PN$X N<
getHibernateTemplate().save(entity); osOVg0Gyj
} +B'8|5tPX
zP:cE
publicvoid persist(finalObject entity){ FYb34LY
getHibernateTemplate().save(entity); W(25TbQ
} +&X%<S
W
-w;(cE
publicvoid update(finalObject entity){ v}sY|p"
getHibernateTemplate().update(entity); T/c<23i
} !Oj)B1gc6&
K.%U
publicvoid delete(finalObject entity){ c{>uqPTY
getHibernateTemplate().delete(entity); /w8"=6Vv~
} fQ'.8'>T
&m {kHM
publicObject load(finalClass entity, )-Ej5'iHr
?!=iu!J
finalSerializable id){ 4"@GNk~e
return getHibernateTemplate().load x lsqj`=
4g}FB+[u
(entity, id); R#n%cXc|
} R*zO
dxY
!j1[$% =#
publicObject get(finalClass entity, tp:\j@dB
Um)>2|rp}
finalSerializable id){ `e]6#iJ^
return getHibernateTemplate().get C{Asp
MlJVeod
(entity, id); (>=7ng^
} YB)3X[R+0
E15vq6 DKF
publicList findAll(finalClass entity){ iB1i/l
return getHibernateTemplate().find("from RGIoI]_
BPqGJ7@
" + entity.getName()); j J3zF3Id
} v)f7};"z
.fzu"XAPu
publicList findByNamedQuery(finalString >r)X:K+I
QC0!p"
namedQuery){ Q}*y$se!
return getHibernateTemplate ]DvO:tM
|2`"1gt
().findByNamedQuery(namedQuery); =s}Xy_+:
} joa5|t!D9
QM5 .f+/
publicList findByNamedQuery(finalString query, Ch_xyuJ
_P,^_%}V06
finalObject parameter){ Te{ *6-gO3
return getHibernateTemplate >p])it[q&$
6P`)%zj
().findByNamedQuery(query, parameter); JI|6B
} Ogg#jx(4
/%n`V
publicList findByNamedQuery(finalString query, |xr\H8:(!
1%J.WH6eQ
finalObject[] parameters){ `Zz uo16
return getHibernateTemplate ~vgA7E/XV
aF8k/$u
().findByNamedQuery(query, parameters); I,ci >/+b
} _2hXa!yO
PfG`C5
d
publicList find(finalString query){ ,WWj-X|+=
return getHibernateTemplate().find y69J%/c
ra
P20|RvE
(query); k_GP>b\"k
} p|XAlia
8I+d)(:
publicList find(finalString query, finalObject K3mAXC,d
?Qqd "=k4
parameter){ K(T\9J.
return getHibernateTemplate().find 'GJVWpvUU
M R'o{?{e`
(query, parameter); ~2uh'e3
} U5/qf8)yO
Qbeeq6
public PaginationSupport findPageByCriteria zz_[S{v!#
?4z8)E9Ju
(final DetachedCriteria detachedCriteria){ 5V-jMB
return findPageByCriteria $R^AEa7
Q;h3v1GC\P
(detachedCriteria, PaginationSupport.PAGESIZE, 0); o%y;(|4t >
} V+Xl9v4O
r;iV$Rq!
public PaginationSupport findPageByCriteria *(GZ^QH.
8v
yG*UK
(final DetachedCriteria detachedCriteria, finalint sI 4yG
U!e6FHj7
startIndex){ Az,-
Cq
return findPageByCriteria MZ#T^Y
.dq
"k
(detachedCriteria, PaginationSupport.PAGESIZE,
N<JHjq
vz`@x45K
startIndex); o*ANi;1]&B
} 6ri#Lw
8
#oR/Nt
public PaginationSupport findPageByCriteria ?\H.S9CZ^
$zkH|]
zZ
(final DetachedCriteria detachedCriteria, finalint
ErbSl
V!|e#}1/
pageSize, SFjU0*B$
finalint startIndex){ =^h~!ovj:
return(PaginationSupport) Fa3gJ[ZAqf
S|R|]J|
getHibernateTemplate().execute(new HibernateCallback(){ 3@5p"X
publicObject doInHibernate 8&}~'4[b[$
xRDiRj
(Session session)throws HibernateException { &K:' #[3V
Criteria criteria = #iis/6"
fk5XvL
detachedCriteria.getExecutableCriteria(session); <9@7,2
int totalCount =
S2=%x.
0^_MN~s(X
((Integer) criteria.setProjection(Projections.rowCount C|z%P}u#p
#i@h{R01
()).uniqueResult()).intValue(); %!.M~5mCd
criteria.setProjection H`<?<ak6'M
sm s1%%~
(null); 8?jxDW
a
List items = bY#;E;'7
_|n=cC4Qu
criteria.setFirstResult(startIndex).setMaxResults U6WG?$x
rS~qi}4X
(pageSize).list(); vC9@,[
PaginationSupport ps = (:$9%,x
p$!@I
new PaginationSupport(items, totalCount, pageSize, B.-A $/
d><fu]'
startIndex); qw:9zYG}qW
return ps; T_L6 t66I
} !p%@Deu
}, true); yMIT(
} =Nl5{qYz^&
~8Sqa%F>
public List findAllByCriteria(final k@qWig
B1w0cS%%:
DetachedCriteria detachedCriteria){ nN{dORJlx
return(List) getHibernateTemplate 1
Nk1MGV
;?im(9h"v!
().execute(new HibernateCallback(){ aR(E7mXQ
publicObject doInHibernate &d
3HB=x
&|z544
(Session session)throws HibernateException { U6i~A9;
Criteria criteria = +G!v!(Ob+
&,uC9$
detachedCriteria.getExecutableCriteria(session); J'7 y
return criteria.list(); =49o U
} !d4HN.a7+u
}, true); PHkDb/HIx|
} A#:8X1w
u[`v&e
public int getCountByCriteria(final )l2P}k7`
Qg>L,ZO
DetachedCriteria detachedCriteria){ <lx^aakk!
Integer count = (Integer) 3W j,}
~x+Ykq0
getHibernateTemplate().execute(new HibernateCallback(){ U(A4v0T
publicObject doInHibernate 9 x [X<
`V~LV<v5
(Session session)throws HibernateException { ^?Vq L\V5
Criteria criteria = ;l`X!3
lQr6;D}+
detachedCriteria.getExecutableCriteria(session); -RCv7U`
return !d|8'^gc
j&llrN
criteria.setProjection(Projections.rowCount AFtCqq#[
El1:?4;
()).uniqueResult(); B}k'@;G
} (+$ol'i
}, true); {fElto
return count.intValue(); xc*!W*04
} F(G<*lA
} o~}1oN
5\+EHW!o
bQ=s8'
0Ts!(b]B
s9:%s*$u
l)iv\j
用户在web层构造查询条件detachedCriteria,和可选的 %30T{n:
I W8.
startIndex,调用业务bean的相应findByCriteria方法,返回一个 g?$e^ls
z-)*Q
PaginationSupport的实例ps。 7n<#y;wo
}RDb1~6C
ps.getItems()得到已分页好的结果集 Z3I L8
ps.getIndexes()得到分页索引的数组 xK=J.>h3
ps.getTotalCount()得到总结果数 IPkA7VhFF
ps.getStartIndex()当前分页索引 X#Ak'%J
ps.getNextIndex()下一页索引 ~\-r
ps.getPreviousIndex()上一页索引 ylT6h_z1[Y
$KH@,;Xz
wC(XRqlE
0JrK/Ma3
#
s,Y%
Bce
6BR\iZ
u[:
P
连续看了两篇robbin有关DetachedCriteria的介绍,感觉真的不错 U!.~XT=
0~:eSWz=
,尤其是上面的示例代码,让我着实觉得该对我原来的分页查询做 M@5KoMsB9
,Os7T 1>
一下代码重构了。 9DY|Sa]#=
D'85VZEFyo
我把原本我的做法也提供出来供大家讨论吧: oFwG+W/
widI
s[
)
首先,为了实现分页查询,我封装了一个Page类: nxf{PbHk
java代码: ;4R=eI
HUD7{6}4
mC%%)F'Zf
/*Created on 2005-4-14*/ T&mbXMN
package org.flyware.util.page; e%'z=%(
rSzQUn<
/** CF,8f$:2
* @author Joa )Xq@v']%~9
* HgS<Vxmq
*/ 65;|cmjv
publicclass Page { 4LJ]l:m
zuUQ."#i
/** imply if the page has previous page */ A-X
privateboolean hasPrePage; Ny]'RS-
.Kg|f~InO
/** imply if the page has next page */ !~ BZHi6\
privateboolean hasNextPage; 2Ti" s -
3"f)*w7d
/** the number of every page */ V^9$t/c&
privateint everyPage; 'MSEki67
ze*&*csO
/** the total page number */ R Co eJ|
privateint totalPage; d.LOyO
Dl>*L
/** the number of current page */ :h^O{"au^
privateint currentPage; [vZfH!vLP
0~(\lkh*!9
/** the begin index of the records by the current &NlS =
%H 8A=
query */ -B<O_*wOj
privateint beginIndex; DN4fP-m-
E~rs11
:5$xh
/** The default constructor */ )[e%wPu4e
public Page(){ Z TN:|IKT
W\nHX I
} lNq:JVJ#\r
Jsl k
/** construct the page by everyPage E\
K
* @param everyPage E`A<]dAoK
* */ L"Qh_+
public Page(int everyPage){ i5ajM,i/K
this.everyPage = everyPage; R>/QARX
}
"$`wk
2U=/<3;u
/** The whole constructor */ ^#<:<X6
public Page(boolean hasPrePage, boolean hasNextPage, g,A.Y,})
[K"U_b}w
e6tH/`Uln
int everyPage, int totalPage, N*_/@qM> a
int currentPage, int beginIndex){ z Y$X|=f
this.hasPrePage = hasPrePage; HA$^ *qn
this.hasNextPage = hasNextPage; zz7Y/653
this.everyPage = everyPage; 4iYgs-,
this.totalPage = totalPage; %RCl+hOP.h
this.currentPage = currentPage; ]+^;vc 1r
this.beginIndex = beginIndex; s_S<gR
} NqQM!B]
owfp^hla
/** B2ek&<I7N
* @return :t2 9`x
* Returns the beginIndex. Z;|0"K
*/ vjOG?-
publicint getBeginIndex(){ %igFHh?
return beginIndex; GInZ53cQ
} *F26}q
.g6PrhzFbk
/** hqhu^.}]
* @param beginIndex 1qB!RIau
* The beginIndex to set. h,!G7V
*/ h|(ZXCH
publicvoid setBeginIndex(int beginIndex){ 1YF+(fk
this.beginIndex = beginIndex; ?.rH;:9To
} hQd@bN8
}}4sh5z
/** 4yJ*85e]
* @return (T>?8K_d
* Returns the currentPage. >?\v@
*/ $UFge%`,q@
publicint getCurrentPage(){ X/-
W8
return currentPage; fD3jwPL
} ,ZzB#\
)vEHLp.
/** rL!_&|
* @param currentPage 4~m.#6MT
* The currentPage to set. cu.*4zs
*/ 4Vb}i[</
publicvoid setCurrentPage(int currentPage){ 6b#:H~ <
this.currentPage = currentPage; zkT`] @`J
} SIaUrC
Q`@$j,v
/** '%n<MTL
* @return w(vE2Y ?
* Returns the everyPage. ,w9#%=xE
*/ ex@,F,u>o
publicint getEveryPage(){
Gh)sw72
return everyPage; -H ac^4uF
} U- *8%>Qp
W|r+J8
/** > hDsm;,/
* @param everyPage tpNtoqg_$
* The everyPage to set. &.+n
L
*/ s{1Deek=
publicvoid setEveryPage(int everyPage){ Th&Wq
this.everyPage = everyPage; DJD ]aI
} V#-qKV
P*0nT
/** z'\}/k+
* @return iSZctsqE
* Returns the hasNextPage. -A-hxK*^
*/ </+%R"`
publicboolean getHasNextPage(){ !%Hl#Pv}
return hasNextPage; Dh!iY0Lz
} },Re5W nl
^ sf[dr;BA
/** 3x(MvW30Lg
* @param hasNextPage =jV%O$Fx
* The hasNextPage to set. f'zU^/$rf
*/ fzkCI
publicvoid setHasNextPage(boolean hasNextPage){ c`$`0}
this.hasNextPage = hasNextPage; *1o+o$hY2
} 4B3irHs\Q
v8U1uOR,%
/** qUDz(bFk/
* @return j
J`Zz
* Returns the hasPrePage. .5KC'?
*/ xM'S
;Sg
publicboolean getHasPrePage(){ N?2#YTjR
return hasPrePage; evg 7d
} 4U! .UNi
"z#?OV5
/** cyHak u+
* @param hasPrePage WFeMr%Zqh>
* The hasPrePage to set. |U#w?eE=
*/ HgSmAziv
publicvoid setHasPrePage(boolean hasPrePage){ >Xh(`^}SQ*
this.hasPrePage = hasPrePage; )- 6s7
} '4^V4i
m`yn9(1Y[
/** 5|~r{w)9
* @return Returns the totalPage. CyK$XDHa
* w
/W
Cj4`
*/ F~Z 0
publicint getTotalPage(){ 4MtqQq4%
return totalPage; T956L'.+G
} 49J+&G?)j
mBpsgm:g^
/** +U_-Lq )
* @param totalPage \xO2WD
* The totalPage to set. X!+Mgh6
*/ 5%Fn^u:
publicvoid setTotalPage(int totalPage){ SX?$H~A
this.totalPage = totalPage; ^;k _
} /c$Ht
EYx2IJ
} 0w[0%:R^
A_(+r
_E&vE5<-$
Am0.c0h
"!6 B5Oz
上面的这个Page类对象只是一个完整的Page描述,接下来我写了一 = C'e1=]
n0_Az2
个PageUtil,负责对Page对象进行构造: z$BnEd.y=:
java代码: NKUI! [
$vGEY7,
iq^L~RW5e
/*Created on 2005-4-14*/ !^w\$cw&
package org.flyware.util.page; 18/@:u{
MMA@J
import org.apache.commons.logging.Log; J2rLsNC]0
import org.apache.commons.logging.LogFactory; =<'iLQb1
0rm;)[SjF
/** b
gc<)=
* @author Joa xXU/m|
* kN9sug^
*/ /6+%(f}7l
publicclass PageUtil { ^qus `6
'Rh>w=wB'
privatestaticfinal Log logger = LogFactory.getLog ,^IZ[D>u)
x"wM_hl5L
(PageUtil.class); 4TQISu)
4tTZkJc
/** q' V{vFfY%
* Use the origin page to create a new page ot+~|Dl
* @param page *1)NABp6D
* @param totalRecords qQ
DFg`
* @return 2#:]%y;\
*/ uF3p1by
publicstatic Page createPage(Page page, int HToN+z%w3H
^$Io;*N4
totalRecords){ e$^!~+J7
return createPage(page.getEveryPage(), ]o+|jgkt]
,/b/O4`;y
page.getCurrentPage(), totalRecords); |16BidWi
} ^R'!\m|FR
'TN{8~Gt*
/** n#4J]Z@
* the basic page utils not including exception 0l1]QD+Gc5
:*Ggz|
handler h7]]F{r5
* @param everyPage @1ta`7#
* @param currentPage .9fluAG
* @param totalRecords 4e#K.HU_
* @return page rU^ghF
*/ cf!k
9x9Z
publicstatic Page createPage(int everyPage, int UlN|Oy,
Sd{"A0[A|
currentPage, int totalRecords){ @"0N @gU
everyPage = getEveryPage(everyPage); K<w5[E9V.
currentPage = getCurrentPage(currentPage); >hL'#;:f#
int beginIndex = getBeginIndex(everyPage, VaIP
` dUiz5o'
currentPage); z57papo
int totalPage = getTotalPage(everyPage, v8k^=A:
*4^]?Y\*
totalRecords); [<fLPa
boolean hasNextPage = hasNextPage(currentPage, 8'xnhV
,0~
{nQ j]
totalPage); dVt@D&
boolean hasPrePage = hasPrePage(currentPage); =XBXSW8)DJ
x-#9i
returnnew Page(hasPrePage, hasNextPage, Mh.eAM8 _
everyPage, totalPage, #DRtMrfat
currentPage, 2P=~3g*
; F(01
beginIndex); P"~T*Qq-R
} l(#Y8
(@o
/>T
privatestaticint getEveryPage(int everyPage){ }qdJ8K
return everyPage == 0 ? 10 : everyPage; LXF%~^^@d
} j6HbJ#]
2y7q
x1$C
privatestaticint getCurrentPage(int currentPage){ Jc?ssm\%
return currentPage == 0 ? 1 : currentPage; nW%=k!''
} p33GKg0i+(
vhEs +j
privatestaticint getBeginIndex(int everyPage, int j<P%Uy+
* !Y3N<>!
currentPage){ JI,hy
<3l0
return(currentPage - 1) * everyPage; .*f4e3
} #R PB;#{
L0VR(
privatestaticint getTotalPage(int everyPage, int ?HyioLO
e CUcE(
totalRecords){ ZWW8Hr
int totalPage = 0; 9qy 9
}o:sx/=u_
if(totalRecords % everyPage == 0) `oWjq6
totalPage = totalRecords / everyPage; y]Tn#4 ,/
else c@B%`6kF
totalPage = totalRecords / everyPage + 1 ; RcM0VbR"EU
vm^# aoDB
return totalPage; B@v H1T
} ,:4w$!;
}UdqX1jz
privatestaticboolean hasPrePage(int currentPage){ E
d/O\v@
return currentPage == 1 ? false : true; _NnOmwK7
} H
7F~+Q-}
o5XUDDi
privatestaticboolean hasNextPage(int currentPage, uPv?Hq
SfFR
int totalPage){ F^G`Jf
return currentPage == totalPage || totalPage == BmF>IQ`M?
1O7ss_E
0 ? false : true; #R~NR8(z
} k$_]b0D{4
Z|dZc wo
;l?(VqX_E
} NS;8&