|
27 | 27 | import org.apache.commons.logging.Log;
|
28 | 28 | import org.apache.commons.logging.LogFactory;
|
29 | 29 | import org.springframework.context.ApplicationContextAware;
|
| 30 | +import org.springframework.core.convert.ConversionException; |
| 31 | +import org.springframework.core.convert.ConversionFailedException; |
30 | 32 | import org.springframework.core.convert.converter.Converter;
|
| 33 | +import org.springframework.dao.DataAccessException; |
| 34 | +import org.springframework.dao.NonTransientDataAccessException; |
31 | 35 | import org.springframework.data.convert.CustomConversions;
|
32 | 36 | import org.springframework.data.jdbc.core.mapping.AggregateReference;
|
33 | 37 | import org.springframework.data.jdbc.core.mapping.JdbcValue;
|
34 | 38 | import org.springframework.data.jdbc.support.JdbcUtil;
|
35 | 39 | import org.springframework.data.mapping.context.MappingContext;
|
36 | 40 | import org.springframework.data.mapping.model.SimpleTypeHolder;
|
37 | 41 | import org.springframework.data.mapping.model.ValueExpressionEvaluator;
|
| 42 | +import org.springframework.data.relational.core.conversion.DbActionExecutionException; |
38 | 43 | import org.springframework.data.relational.core.conversion.MappingRelationalConverter;
|
39 | 44 | import org.springframework.data.relational.core.conversion.ObjectPath;
|
40 | 45 | import org.springframework.data.relational.core.conversion.RelationalConverter;
|
@@ -179,8 +184,7 @@ protected Object readTechnologyType(Object value) {
|
179 | 184 | try {
|
180 | 185 | return array.getArray();
|
181 | 186 | } catch (SQLException e) {
|
182 |
| - LOG.info("Failed to extract a value of type %s from an Array; Attempting to use standard conversions", e); |
183 |
| - |
| 187 | + throw new FailedToAccessJdbcArrayException(e); |
184 | 188 | }
|
185 | 189 | }
|
186 | 190 |
|
@@ -301,6 +305,12 @@ protected RelationalPropertyValueProvider newValueProvider(RowDocumentAccessor d
|
301 | 305 | return super.newValueProvider(documentAccessor, evaluator, context);
|
302 | 306 | }
|
303 | 307 |
|
| 308 | + private static class FailedToAccessJdbcArrayException extends NonTransientDataAccessException { |
| 309 | + public FailedToAccessJdbcArrayException(SQLException e) { |
| 310 | + super("Failed to read array", e); |
| 311 | + } |
| 312 | + } |
| 313 | + |
304 | 314 | /**
|
305 | 315 | * {@link RelationalPropertyValueProvider} using a resolving context to lookup relations. This is highly
|
306 | 316 | * context-sensitive. Note that the identifier is held here because of a chicken and egg problem, while
|
|
0 commit comments