REST API - Exception when invoke a service which has an entity with @MetaProperty method as an argument #PL-5867

This commit is contained in:
Maxim Gorbunkov 2015-08-26 10:24:13 +00:00
parent 31aab557fa
commit b418d1b3b9
2 changed files with 4 additions and 2 deletions

View File

@ -478,7 +478,8 @@ public class JSONConvertor implements Convertor {
MetaClass metaClass = loadInfo.getMetaClass();
Entity instance = metadata.create(metaClass);
for (MetaProperty metaProperty : metaClass.getProperties()) {
instance.setValue(metaProperty.getName(), null);
if (!metaProperty.isReadOnly())
instance.setValue(metaProperty.getName(), null);
}
return instance;
}

View File

@ -459,7 +459,8 @@ public class XMLConvertor2 implements Convertor {
MetaClass metaClass = loadInfo.getMetaClass();
Entity instance = metadata.create(metaClass);
for (MetaProperty metaProperty : metaClass.getProperties()) {
instance.setValue(metaProperty.getName(), null);
if (!metaProperty.isReadOnly())
instance.setValue(metaProperty.getName(), null);
}
return instance;
}