@ -117,6 +117,11 @@ public class StringBasedJdbcQuery extends AbstractJdbcQuery {
@@ -117,6 +117,11 @@ public class StringBasedJdbcQuery extends AbstractJdbcQuery {
thrownewUnsupportedOperationException(
"Page queries are not supported using string-based queries; Offending method: "+queryMethod);
@ -100,6 +100,21 @@ public class StringBasedR2dbcQuery extends AbstractR2dbcQuery {
@@ -100,6 +100,21 @@ public class StringBasedR2dbcQuery extends AbstractR2dbcQuery {
@ -143,6 +147,22 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@@ -143,6 +147,22 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@ -423,6 +443,8 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@@ -423,6 +443,8 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@ -483,6 +505,7 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@@ -483,6 +505,7 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
publicLegoSet(){
}
@Override
publicStringgetName(){
returnthis.name;
}
@ -547,15 +570,15 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@@ -547,15 +570,15 @@ public abstract class AbstractR2dbcRepositoryIntegrationTests extends R2dbcInteg
@ -169,6 +169,9 @@ Properties that don't have a matching column in the result will not be set.
@@ -169,6 +169,9 @@ Properties that don't have a matching column in the result will not be set.
The query is used for populating the aggregate root, embedded entities and one-to-one relationships including arrays of primitive types which get stored and loaded as SQL-array-types.
Separate queries are generated for maps, lists, sets and arrays of entities.
WARNING: Note that String-based queries do not support pagination nor accept `Sort`, `PageRequest`, and `Limit` as a query parameter as for these queries the query would be required to be rewritten.
If you want to apply limiting, please express this intent using SQL and bind the appropriate parameters to the query yourself.
Queries may contain SpEL expressions where bind variables are allowed.
Such a SpEL expression will get replaced with a bind variable and the variable gets bound to the result of the SpEL expression.
@ -182,6 +182,27 @@ Therefore also fields with auditing annotations do not get updated if they don't
@@ -182,6 +182,27 @@ Therefore also fields with auditing annotations do not get updated if they don't
Alternatively, you can add custom modifying behavior by using the facilities described in xref:repositories/custom-implementations.adoc[Custom Implementations for Spring Data Repositories].
[[r2dbc.query-methods.at-query]]
== Using `@Query`
The following example shows how to use `@Query` to declare a query method:
WARNING: Note that String-based queries do not support pagination nor accept `Sort`, `PageRequest`, and `Limit` as a query parameter as for these queries the query would be required to be rewritten.
If you want to apply limiting, please express this intent using SQL and bind the appropriate parameters to the query yourself.
NOTE: Spring fully supports Java 8’s parameter name discovery based on the `-parameters` compiler flag.
By using this flag in your build as an alternative to debug information, you can omit the `@Param` annotation for named parameters.