|
44 | 44 | import org.springframework.data.mapping.PersistentPropertyAccessor;
|
45 | 45 | import org.springframework.data.mapping.PersistentPropertyPathAccessor;
|
46 | 46 | import org.springframework.data.mapping.context.MappingContext;
|
47 |
| -import org.springframework.data.mapping.model.*; |
| 47 | +import org.springframework.data.mapping.model.CachingValueExpressionEvaluatorFactory; |
| 48 | +import org.springframework.data.mapping.model.ConvertingPropertyAccessor; |
| 49 | +import org.springframework.data.mapping.model.EntityInstantiator; |
| 50 | +import org.springframework.data.mapping.model.ParameterValueProvider; |
| 51 | +import org.springframework.data.mapping.model.PersistentEntityParameterValueProvider; |
| 52 | +import org.springframework.data.mapping.model.PropertyValueProvider; |
| 53 | +import org.springframework.data.mapping.model.SimpleTypeHolder; |
| 54 | +import org.springframework.data.mapping.model.SpELContext; |
| 55 | +import org.springframework.data.mapping.model.ValueExpressionEvaluator; |
| 56 | +import org.springframework.data.mapping.model.ValueExpressionParameterValueProvider; |
48 | 57 | import org.springframework.data.projection.EntityProjection;
|
49 | 58 | import org.springframework.data.projection.EntityProjectionIntrospector;
|
50 | 59 | import org.springframework.data.projection.EntityProjectionIntrospector.ProjectionPredicate;
|
|
66 | 75 | import org.springframework.lang.Nullable;
|
67 | 76 | import org.springframework.util.Assert;
|
68 | 77 | import org.springframework.util.ClassUtils;
|
| 78 | +import org.springframework.util.ObjectUtils; |
69 | 79 |
|
70 | 80 | /**
|
71 | 81 | * {@link org.springframework.data.relational.core.conversion.RelationalConverter} that uses a
|
@@ -1164,37 +1174,15 @@ public boolean hasValue(AggregatePath path) {
|
1164 | 1174 | if (value == null) {
|
1165 | 1175 | return false;
|
1166 | 1176 | }
|
| 1177 | + |
1167 | 1178 | if (!path.isCollectionLike()) {
|
1168 | 1179 | return true;
|
1169 | 1180 | }
|
1170 | 1181 |
|
1171 |
| - if (value instanceof char[] ar) { |
1172 |
| - return ar.length != 0; |
1173 |
| - } |
1174 |
| - if (value instanceof byte[] ar) { |
1175 |
| - return ar.length != 0; |
1176 |
| - } |
1177 |
| - if (value instanceof short[] ar) { |
1178 |
| - return ar.length != 0; |
1179 |
| - } |
1180 |
| - if (value instanceof int[] ar) { |
1181 |
| - return ar.length != 0; |
1182 |
| - } |
1183 |
| - if (value instanceof long[] ar) { |
1184 |
| - return ar.length != 0; |
1185 |
| - } |
1186 |
| - if (value instanceof float[] ar) { |
1187 |
| - return ar.length != 0; |
1188 |
| - } |
1189 |
| - if (value instanceof double[] ar) { |
1190 |
| - return ar.length != 0; |
1191 |
| - } |
1192 |
| - if (value instanceof Object[] ar) { |
1193 |
| - return ar.length != 0; |
1194 |
| - } |
1195 |
| - if (value instanceof Collection<?> col) { |
1196 |
| - return !col.isEmpty(); |
| 1182 | + if (value instanceof Collection<?> || value.getClass().isArray()) { |
| 1183 | + return !ObjectUtils.isEmpty(value); |
1197 | 1184 | }
|
| 1185 | + |
1198 | 1186 | return true;
|
1199 | 1187 | }
|
1200 | 1188 |
|
|
0 commit comments