mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 16:25:36 +00:00
#1839 - Fix JSON marshalling of @ElementCollection maps and scalar
This commit is contained in:
1 parent
20dd33ebca
commit
8890079b80
17 files changed
+206
-45
No files matched your search
@@ -971,7 +971,11 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
}
|
||||
|
||||
void jsonWriteMapEntry(SpiJsonWriter ctx, Map.Entry<?, ?> entry) throws IOException {
|
||||
elementDescriptor.jsonWriteMapEntry(ctx, entry);
|
||||
if (elementDescriptor != null) {
|
||||
elementDescriptor.jsonWriteMapEntry(ctx, entry);
|
||||
} else {
|
||||
targetDescriptor.jsonWrite(ctx, (EntityBean)entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
void jsonWriteElementValue(SpiJsonWriter ctx, Object element) {
|
||||
@@ -1051,10 +1055,9 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
*/
|
||||
public Object jsonReadCollection(SpiJsonReader readJson, EntityBean parentBean) throws IOException {
|
||||
|
||||
if (elementDescriptor != null && manyType.isMap()) {
|
||||
if (elementDescriptor != null && elementDescriptor.isJsonReadCollection()) {
|
||||
return elementDescriptor.jsonReadCollection(readJson, parentBean);
|
||||
}
|
||||
|
||||
BeanCollection<?> collection = createEmpty(parentBean);
|
||||
BeanCollectionAdd add = getBeanCollectionAdd(collection);
|
||||
do {
|
||||
|
||||
Reference in new issue
Block a user