how can i implement a pagination in spring jdbcTemplate

后端 未结 4 1853
时光取名叫无心
时光取名叫无心 2021-01-13 23:22

here is my following dao implementaion

@Override
    public List getAddresses(int pageid,int total) {

        String sql = \"select * FRO         


        
4条回答
  •  误落风尘
    2021-01-14 00:05

    I came across this while I was searching for something else, and noticed this has not been answered, so thought to post my 2cents. You can create a wrapper (Request) object containing Pagination object and pageId.

    Request

    • Pagination pagination
    • int pageId (any business related data/ SQL parameter)
    • ANY DOMAIN OBJECT

    Pagination

    • int start (Use to set OFFSET property in the SQL)
    • int size (Use to set the FETCH NEXT property in the SQL)

提交回复
热议问题