Announcement Announcement Module
Collapse
No announcement yet.
ibatis pagination Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ibatis pagination

    Can anyone provide me with an example for pagination using ibatis,

    I saw one example as below:-

    Code:
    PaginatedList list = sqlMap.queryForPaginatedList("getContacts", null, 2);
    while (true) {
        Iterator listIterator = list.iterator();
        while (listIterator.hasNext()) {
            System.out.println(
                ((Contact)listIterator.next()).getContactId());
        }
        if( list.isNextPageAvailable())
            list.nextPage();
        else
            break;
    }
    It is has mentioned that queryForPaginatedList is deprecated,what is to be used for , can anyone give any example.

  • #2
    actually, that's a good question. what method should we use instead?

    Any idea?

    Comment


    • #3
      one of overloaded SqlMapClientTemplate.queryForList method is capable of performing pagination...

      Code:
      public List queryForList(final String statementName, final Object parameterObject, final int skipResults, final int maxResults)

      Comment

      Working...
      X