#985 - IllegalArgumentException when using @DbArray of type List<String> with @ChangeLog

This commit is contained in:
Rob Bygrave committed 2017-03-05 11:40:08 +13:00
1 parent 289c0253b1
commit 75b9e748f4
1 file changed
+13
@@ -5,6 +5,7 @@ import io.ebeaninternal.server.type.TypeManager;
import com.fasterxml.jackson.core.JsonGenerator;
import java.io.IOException;
import java.util.List;
/**
* Default implementation of JsonScalar.
@@ -23,6 +24,18 @@ public class DJsonScalar {
if (value instanceof String) {
gen.writeString((String) value);
} else if (value instanceof List) {
// expected for @DbArray values
List list = (List)value;
gen.writeRaw('[');
for (int i = 0; i < list.size(); i++) {
if (i > 0) {
gen.writeRaw(',');
}
write(gen, list.get(i));
}
gen.writeRaw(']');
} else {
ScalarType scalarType = typeManager.getScalarType(value.getClass());
if (scalarType == null) {