You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2020-04-08 12:02:17.777 DEBUG 9184 --- [ctor-http-nio-2] o.s.d.r2dbc.core.DefaultDatabaseClient : Executing SQL statement [SELECT city.city_id, city.name, city.state, city.country, city.lat, city.lng FROM city WHERE UPPER(city.name) LIKE UPPER($1) ORDER BY name ASC]
2020-04-08 12:02:17.778 DEBUG 9184 --- [ctor-http-nio-2] o.s.d.r2dbc.core.NamedParameterExpander : Expanding SQL statement [SELECT city.city_id, city.name, city.state, city.country, city.lat, city.lng FROM city WHERE UPPER(city.name) LIKE UPPER($1) ORDER BY name ASC] to [SELECT city.city_id, city.name, city.state, city.country, city.lat, city.lng FROM city WHERE UPPER(city.name) LIKE UPPER($1) ORDER BY name ASC]
According to the log, we can see only the sort is used and the query returns all rows matched to the where clause ordered by name.
But when I change the method in the repository to findTop10ByNameContainingIgnoreCase the log changes to:
2020-04-08 12:07:32.121 DEBUG 13020 --- [ctor-http-nio-2] o.s.d.r2dbc.core.DefaultDatabaseClient : Executing SQL statement [SELECT city.city_id, city.name, city.state, city.country, city.lat, city.lng FROM city WHERE UPPER(city.name) LIKE UPPER($1) ORDER BY name ASC LIMIT 10]
2020-04-08 12:07:32.121 DEBUG 13020 --- [ctor-http-nio-2] o.s.d.r2dbc.core.NamedParameterExpander : Expanding SQL statement [SELECT city.city_id, city.name, city.state, city.country, city.lat, city.lng FROM city WHERE UPPER(city.name) LIKE UPPER($1) ORDER BY name ASC LIMIT 10] to [SELECT city.city_id, city.name, city.state, city.country, city.lat, city.lng FROM city WHERE UPPER(city.name) LIKE UPPER($1) ORDER BY name ASC LIMIT 10]
which adds the limit to the query.
So, why passing Pageable to the query doesn't work for me? Am I missing something?
The text was updated successfully, but these errors were encountered:
It's my first experience with spring-data-r2dbc, so I'm not sure if it's a bug or I'm missing something.
Description
I'm using
spring-data-r2dbc
withKotlin
andWebFlux
.build.gradle.kts
:Assuming I have a simple Repository:
CityRepository
:When I call the
findByNameContainingIgnoreCase
with the following parameters:the generated log is:
According to the log, we can see only the sort is used and the query returns all rows matched to the
where
clause ordered by name.But when I change the method in the repository to
findTop10ByNameContainingIgnoreCase
the log changes to:which adds the
limit
to the query.So, why passing
Pageable
to the query doesn't work for me? Am I missing something?The text was updated successfully, but these errors were encountered: