Skip to content

Commit 61c7729

Browse files
committed
Polishing.
See #1460 Original pull request #1521
1 parent c55ba78 commit 61c7729

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
* @author Milan Milanov
8989
* @author Mikhail Polivakha
9090
* @author Chirag Tailor
91+
* @author Vincent Galloy
9192
*/
9293
@ContextConfiguration
9394
@Transactional
@@ -1083,11 +1084,13 @@ void insertOnlyPropertyDoesNotGetUpdated() {
10831084
}
10841085

10851086
@Test // GH-1460
1087+
@EnabledOnFeature(SUPPORTS_ARRAYS)
10861088
void readEnumArray() {
1089+
10871090
EnumArrayOwner entity = new EnumArrayOwner();
10881091
entity.digits = new Color[]{Color.BLUE};
10891092

1090-
assertThat(template.save(entity)).isNotNull();
1093+
template.save(entity);
10911094

10921095
assertThat(template.findById(entity.id, EnumArrayOwner.class).digits).isEqualTo(new Color[]{Color.BLUE});
10931096
}

spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
* @author Mark Paluch
5555
* @author Jens Schauder
5656
* @author Chirag Tailor
57+
* @author Vincent Galloy
5758
* @see MappingContext
5859
* @see SimpleTypeHolder
5960
* @see CustomConversions
@@ -176,7 +177,11 @@ public Object writeValue(@Nullable Object value, TypeInformation<?> type) {
176177

177178
// TODO: We should add conversion support for arrays, however,
178179
// these should consider multi-dimensional arrays as well.
179-
if (value.getClass().isArray() && !value.getClass().getComponentType().isEnum() && (TypeInformation.OBJECT.equals(type) || type.isCollectionLike())) {
180+
if (value.getClass().isArray() //
181+
&& !value.getClass().getComponentType().isEnum() //
182+
&& (TypeInformation.OBJECT.equals(type) //
183+
|| type.isCollectionLike()) //
184+
) {
180185
return value;
181186
}
182187

0 commit comments

Comments
 (0)