Fix Enum[] type conversion.
Since 3.0.5, Enum[] type are detect as "UNKNOWN" Closes #1460 Original Pull request #1521
This commit is contained in:
committed by
Jens Schauder
parent
b07abd7afc
commit
fb97bfca97
@@ -1082,6 +1082,16 @@ class JdbcAggregateTemplateIntegrationTests {
|
||||
assertThat(template.findById(entity.id, WithInsertOnly.class).insertOnly).isEqualTo("first value");
|
||||
}
|
||||
|
||||
@Test // GH-1460
|
||||
void readEnumArray() {
|
||||
EnumArrayOwner entity = new EnumArrayOwner();
|
||||
entity.digits = new Color[]{Color.BLUE};
|
||||
|
||||
assertThat(template.save(entity)).isNotNull();
|
||||
|
||||
assertThat(template.findById(entity.id, EnumArrayOwner.class).digits).isEqualTo(new Color[]{Color.BLUE});
|
||||
}
|
||||
|
||||
private <T extends Number> void saveAndUpdateAggregateWithVersion(VersionedAggregate aggregate,
|
||||
Function<Number, T> toConcreteNumber) {
|
||||
saveAndUpdateAggregateWithVersion(aggregate, toConcreteNumber, 0);
|
||||
@@ -1123,6 +1133,17 @@ class JdbcAggregateTemplateIntegrationTests {
|
||||
return jdbcTemplate.queryForObject("SELECT COUNT(*) FROM " + tableName, emptyMap(), Long.class);
|
||||
}
|
||||
|
||||
enum Color {
|
||||
BLUE
|
||||
}
|
||||
|
||||
@Table("ARRAY_OWNER")
|
||||
private static class EnumArrayOwner {
|
||||
@Id Long id;
|
||||
|
||||
Color[] digits;
|
||||
}
|
||||
|
||||
@Table("ARRAY_OWNER")
|
||||
private static class ArrayOwner {
|
||||
@Id Long id;
|
||||
|
||||
Reference in New Issue
Block a user