|
27 | 27 | import java.util.function.Function; |
28 | 28 | import java.util.function.Supplier; |
29 | 29 |
|
| 30 | +import org.apache.commons.logging.Log; |
| 31 | +import org.apache.commons.logging.LogFactory; |
30 | 32 | import org.springframework.beans.BeanInstantiationException; |
31 | 33 | import org.springframework.beans.BeanUtils; |
32 | 34 | import org.springframework.beans.factory.BeanFactory; |
|
78 | 80 | public class StringBasedJdbcQuery extends AbstractJdbcQuery { |
79 | 81 |
|
80 | 82 | private static final String PARAMETER_NEEDS_TO_BE_NAMED = "For queries with named parameters you need to provide names for method parameters; Use @Param for query method parameters, or use the javac flag -parameters"; |
| 83 | + private final static String LOCKING_IS_NOT_SUPPORTED = "Currently, @Lock is supported only on derived queries. In other words, for queries created with @Query, the locking condition specified with @Lock does nothing"; |
| 84 | + private static final Log LOG = LogFactory.getLog(StringBasedJdbcQuery.class); |
81 | 85 | private final JdbcConverter converter; |
82 | 86 | private final RowMapperFactory rowMapperFactory; |
83 | 87 | private final ValueExpressionQueryRewriter.ParsedQuery parsedQuery; |
@@ -187,6 +191,10 @@ public StringBasedJdbcQuery(String query, JdbcQueryMethod queryMethod, NamedPara |
187 | 191 | (counter, expression) -> String.format("__$synthetic$__%d", counter + 1), String::concat); |
188 | 192 |
|
189 | 193 | this.query = query; |
| 194 | + |
| 195 | + if (queryMethod.hasLockMode()) { |
| 196 | + LOG.warn(LOCKING_IS_NOT_SUPPORTED); |
| 197 | + } |
190 | 198 | this.parsedQuery = rewriter.parse(this.query); |
191 | 199 | this.delegate = delegate; |
192 | 200 | } |
|
0 commit comments