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
Please let me know if there is a better place to address usage questions.
I am trying to take an application beyond basic boilerplate by adding both multi-tenancy and pagination/sorting. Tenancy is achieved using a many-to-one relation i.e.
data class Employee(UUID id);
data class Grant(UUID id, UUID grantedEmployee, UUID targetEmployee);
The query for allowed employees would consequently be:
Thus far I have been unable to do so using spring-data-r2dbc. This is what I have tried:
Using a custom query via @Query w/ SPEL. I was able to get pagination working, but there is no way to achieve dynamic sorting because there is no way to generate SQL for the requested sort.
QueryDSL, which apparently is not supported.
Using the fluent API, from which I cannot figure out how to achieve joins but does allow pagination and sorting.
Dynamic sorting through @Query isn't supported because we don't want to get ourselves into query rewriting business. You can use DatabaseClient with your query and new EntityRowMapper<>(typeToRead,converter) (where converter is R2dbcConverter).
We do not support JOINs yet because we don't support relationships yet.
Please let me know if there is a better place to address usage questions.
I am trying to take an application beyond basic boilerplate by adding both multi-tenancy and pagination/sorting. Tenancy is achieved using a many-to-one relation i.e.
data class Employee(UUID id); data class Grant(UUID id, UUID grantedEmployee, UUID targetEmployee);
The query for allowed employees would consequently be:
Thus far I have been unable to do so using
spring-data-r2dbc
. This is what I have tried:@Query
w/ SPEL. I was able to get pagination working, but there is no way to achieve dynamic sorting because there is no way to generate SQL for the requested sort.QueryDSL
, which apparently is not supported.It would be trivial to rewrite the query as:
which could potentially be mapped to a
Criteria
of raw SQL, but I could not find a supporting facility.What is the correct pattern to achieve this? The documentation seems to be lacking when it comes to JOINs.
The text was updated successfully, but these errors were encountered: