Skip to content

Commit a7a9fbc

Browse files
committed
Polishing.
Refining documentation. Original pull request #2008
1 parent 1c15a8b commit a7a9fbc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQuery.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ public StringBasedJdbcQuery(JdbcQueryMethod queryMethod, NamedParameterJdbcOpera
140140
* @since 3.4
141141
*/
142142
public StringBasedJdbcQuery(JdbcQueryMethod queryMethod, NamedParameterJdbcOperations operations,
143-
RowMapperFactory rowMapperFactory, JdbcConverter converter,
144-
ValueExpressionDelegate delegate) {
143+
RowMapperFactory rowMapperFactory, JdbcConverter converter, ValueExpressionDelegate delegate) {
145144
this(queryMethod.getRequiredQuery(), queryMethod, operations, rowMapperFactory, converter, delegate);
146145
}
147146

@@ -158,8 +157,7 @@ public StringBasedJdbcQuery(JdbcQueryMethod queryMethod, NamedParameterJdbcOpera
158157
* @since 3.4
159158
*/
160159
public StringBasedJdbcQuery(String query, JdbcQueryMethod queryMethod, NamedParameterJdbcOperations operations,
161-
RowMapperFactory rowMapperFactory, JdbcConverter converter,
162-
ValueExpressionDelegate delegate) {
160+
RowMapperFactory rowMapperFactory, JdbcConverter converter, ValueExpressionDelegate delegate) {
163161
super(queryMethod, operations);
164162
Assert.hasText(query, "Query must not be null or empty");
165163
Assert.notNull(rowMapperFactory, "RowMapperFactory must not be null");

src/main/antora/modules/ROOT/pages/jdbc/transactions.adoc

+6-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ The required value of type `LockMode` offers two values: `PESSIMISTIC_READ` whic
101101
Some databases do not make this distinction.
102102
In that cases both modes are equivalent of `PESSIMISTIC_WRITE`.
103103

104-
NOTE: It is worth stating explicitly, that `@Lock` currently is not supported on string-based queries. It means,
105-
that queries in the repository, created with `@Query`, will ignore the locking information provided by the `@Lock`,
106-
Using `@Lock` on string-based queries will result in the warning in logs.
107-
108104
.Using @Lock on derived query method
109105
[source,java]
110106
----
@@ -123,3 +119,9 @@ If you are using a databse with the MySQL Dialect this will result for example i
123119
----
124120
Select * from user u where u.lastname = lastname LOCK IN SHARE MODE
125121
----
122+
123+
NOTE: `@Lock` is currently not supported on string-based queries.
124+
Query-methods created with `@Query`, will ignore the locking information provided by the `@Lock`,
125+
Using `@Lock` on string-based queries will result in the warning in logs.
126+
Future versions will throw an exception.
127+

0 commit comments

Comments
 (0)