Order by Comparator
Whenever we create finder method by default it generates many methods associating with it starts by method name as findBy ..... Sometimes it may requires you to display the results in the ASC/DESC. So we have one method which accepts OrderByComparator as parameter. Below example explains you how to retrieve the Title in the Ascending order. OrderByComparator comparator = OrderByComparatorFactoryUtil.create(TestModelImpl.TABLE_NAME, "title", orderByType.equals("asc")) jsonTestEntryPersistance.findByTitle("name",comparator);