11package org .couchbase .quickstart .springdata .repository ;
22
3-
43import org .couchbase .quickstart .springdata .model .Airline ;
54import org .springframework .data .couchbase .repository .Collection ;
65import org .springframework .data .couchbase .repository .CouchbaseRepository ;
@@ -21,28 +20,28 @@ public interface AirlineRepository extends CouchbaseRepository<Airline, String>
2120
2221 // Create the query to find all airlines
2322
24- // @Query("SELECT META().id AS _ID, callsign, country, iata, icao, name, type FROM #{#n1ql.bucket}")
25- // @Query("#{#n1ql.selectEntity} WHERE #{#n1ql.filter}")
23+ // @Query("SELECT META().id AS _ID, callsign, country, iata, icao, name, type
24+ // FROM #{#n1ql.bucket}")
25+ // @Query("#{#n1ql.selectEntity} WHERE #{#n1ql.filter}")
2626 @ Query ("#{#n1ql.selectEntity}" )
2727 Page <Airline > findAll (Pageable pageable );
2828
29- // @Query("SELECT META().id AS _ID, callsign, country, iata, icao, name, type FROM #{#n1ql.bucket} AND country = 'United States'")
29+ // @Query("SELECT META().id AS _ID, callsign, country, iata, icao, name, type
30+ // FROM #{#n1ql.bucket} AND country = 'United States'")
3031 @ Query ("#{#n1ql.selectEntity} WHERE country = $1" )
3132 Page <Airline > findByCountry (String country , Pageable pageable );
3233
33- // @Query("#{#n1ql.selectEntity} FROM (SELECT DISTINCT META(airline).id AS airlineId FROM route " +
34- // "JOIN airline ON route.airlineid = META(airline).id " +
35- // "WHERE route.destinationairport = $1) AS subquery " +
36- // "JOIN #{#n1ql.bucket} AS air ON META(air).id = subquery.airlineId")
34+ // @Query("#{#n1ql.selectEntity} FROM (SELECT DISTINCT META(airline).id AS
35+ // airlineId FROM route " +
36+ // "JOIN airline ON route.airlineid = META(airline).id " +
37+ // "WHERE route.destinationairport = $1) AS subquery " +
38+ // "JOIN #{#n1ql.bucket} AS air ON META(air).id = subquery.airlineId")
3739
3840 @ Query ("SELECT META(air).id AS __id, air.callsign, air.country, air.iata, air.icao, air.id, air.name, air.type " +
3941 "FROM (SELECT DISTINCT META(airline).id AS airlineId FROM route " +
4042 "JOIN airline ON route.airlineid = META(airline).id " +
4143 "WHERE route.destinationairport = 'MRS') AS subquery " +
4244 "JOIN #{#n1ql.bucket} AS air ON META(air).id = subquery.airlineId" )
43- Page <Airline > findByDestinationAirport (Pageable pageable , String destinationAirport );
44-
45-
46-
45+ Page <Airline > findByDestinationAirport (String destinationAirport , Pageable pageable );
4746
4847}
0 commit comments