|
15 | 15 | */
|
16 | 16 | package org.springframework.data.jdbc.repository.query;
|
17 | 17 |
|
18 |
| -import static org.springframework.data.jdbc.repository.query.JdbcQueryExecution.*; |
| 18 | +import static org.springframework.data.jdbc.repository.query.JdbcQueryExecution.ResultProcessingConverter; |
19 | 19 |
|
20 | 20 | import java.lang.reflect.Array;
|
21 | 21 | import java.lang.reflect.Constructor;
|
|
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; |
32 | 30 | import org.springframework.beans.BeanInstantiationException;
|
33 | 31 | import org.springframework.beans.BeanUtils;
|
34 | 32 | import org.springframework.beans.factory.BeanFactory;
|
|
75 | 73 | public class StringBasedJdbcQuery extends AbstractJdbcQuery {
|
76 | 74 |
|
77 | 75 | 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";
|
78 |
| - 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"; |
79 |
| - private static final Log LOG = LogFactory.getLog(StringBasedJdbcQuery.class); |
| 76 | + 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. Offending method: "; |
80 | 77 | private final JdbcConverter converter;
|
81 | 78 | private final RowMapperFactory rowMapperFactory;
|
82 | 79 | private final ValueExpressionQueryRewriter.ParsedQuery parsedQuery;
|
@@ -149,7 +146,7 @@ public StringBasedJdbcQuery(String query, JdbcQueryMethod queryMethod, NamedPara
|
149 | 146 | this.query = query;
|
150 | 147 |
|
151 | 148 | if (queryMethod.hasLockMode()) {
|
152 |
| - LOG.warn(LOCKING_IS_NOT_SUPPORTED); |
| 149 | + throw new UnsupportedOperationException(LOCKING_IS_NOT_SUPPORTED + queryMethod); |
153 | 150 | }
|
154 | 151 | this.parsedQuery = rewriter.parse(this.query);
|
155 | 152 | this.delegate = delegate;
|
|
0 commit comments