Spring Data Mongo Pagination

In today’s post I would give you a sample program which loads data from MongoDb using Spring Data as page by page. This is useful when you load large data set into screen.

The complete source code of this post can be found github.

Libraries Use

Name Version
Spring Framwork 3.2.4.RELEASE
Spring Data Mongo 1.2.2.RELEASE
JUnit 4.8.1
No SQL Unit 0.7.7
MongoDB Java Driver 2.11.0

pom.xml

ProductRepository Source Code

Product Domain Object

ProductRepository Test Class

Pleaes refer the original source code in github for test data and other configuration files.

Leave a comment

Your email address will not be published. Required fields are marked *