Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- vscode
- mac
- Request
- React
- EFCore
- error
- ORM
- Config
- dbContext
- inserttrigger
- LINQ
- DbSave
- scanner
- 명시적외래키
- minimalAPI
- JavaScript
- c#코딩의기술실전편
- JSON
- extraParams
- intellij
- 자원정리
- 코드프로그래머스
- 상속
- .net
- lazy loading
- c#
- extjs
- ViewModel
- ""+n
- Store
Archives
- Today
- Total
ejyoo's 개발 노트
[페이징 관련 코드] [ 작성중] 본문
package kr.or.ddit.command;
public class Criteria {
private int page = 1;
private int perPageNum = 10;
private int startRowNum;
private int endRowNum;
public int getPage() {
return page;
}
public void setPage(int page) {
if (page < 1) page = 1;
this.page = page;
}
public void setPage(String page) {
if (page != null && !page.isEmpty()) {
setPage(Integer.parseInt(page));
} else {
this.page = 1;
}
}
public int getPerPageNum() {
return perPageNum;
}
public void setPerPageNum(int perPageNum) {
if(perPageNum < 1) this.perPageNum = 1;
this.perPageNum = perPageNum;
}
public void setPerPageNum(String perPageNum) {
if (perPageNum != null && !perPageNum.isEmpty()) {
setPerPageNum(Integer.parseInt(perPageNum));
} else {
this.perPageNum = 10;
}
}
public int getStartRowNum() {
this.startRowNum = (this.page - 1) * perPageNum;
return startRowNum;
}
public int getEndRowNum() {
this.endRowNum = this.startRowNum + this.perPageNum;
return endRowNum;
}
}
'BackEnd > JAVA Spring' 카테고리의 다른 글
[Node] <> 로 이루어진 노드의 타입 상수 (0) | 2021.06.01 |
---|---|
톰캣 setCharacterEncodingFilter 설정 (0) | 2021.06.01 |
web.xml의 classpath: 위치 (0) | 2021.05.27 |
ServletContext 라이프 사이클 (0) | 2021.05.27 |
ContextPath 변경방법 ('/'로 변경) (0) | 2021.05.26 |