/**
 * Copyright 2015 Smart Community Lab
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package it.smartcommunitylab.carpooling.mongo.repos;

import it.smartcommunitylab.carpooling.model.Travel;

import java.util.List;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

public interface TravelRepository extends MongoRepository<Travel, String>, TravelRepositoryCustom { 

	@Query("{'userId':?0}")
	List<Travel> findTravelByDriverId(String userId);

	@Query("{'id':?0, 'userId':?1}")
	Travel findTravelByIdAndDriverId(String id, String userId);
	
}

@@ -766,33 +766,111 @@
 ata.
-mongodb.repository.MongoR
+domain.Page;%0Aimport org.springframework.data.domain.Pageable;%0Aimport org.springframework.data.mongodb.r
 epos
@@ -874,16 +874,22 @@
 pository
+.Query
 ;%0Aimport
@@ -910,33 +910,52 @@
 mework.data.
-mongodb.r
+repository.PagingAndSortingR
 epository.Qu
@@ -951,22 +951,16 @@
 pository
-.Query
 ;%0A%0Apubli
@@ -1000,13 +1000,24 @@
 nds 
-Mo
+PagingAndSorti
 ng
-o
 Repo
@@ -1142,16 +1142,113 @@
 userId);
+%0A%09%0A%09@Query(%22%7B'userId':?0%7D%22)%0A%09Page%3CTravel%3E findTravelByDriverId(String userId, Pageable pageable);
 %0A%0A%09@Quer

Fix for usage of PagingAndSortingRepository