mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-14 14:46:25 +00:00
#985 - IllegalArgumentException when using @DbArray of type List<String> with @ChangeLog
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user