Exception saving Entity->Embeddable->Read only member
Automatic frontend engine for Java
Brought to you by:
javierpaniza
Exception when saving an Entity instance that includes an Embeddable one with calculated members.
Details, code and exceptions at:
https://sourceforge.net/projects/openxava/forums/forum/419690/topic/4626451/index/page/1
To fix it was only needed to add a call to removeCalculatedFields() in instanceAggregate() of MapFacadeBean:
private Object instanceAggregate(MetaAggregateForReference metaAggregate, Map values)
throws ValidationException, XavaException, RemoteException {
try {
Object object = Class.forName(metaAggregate.getBeanClass()).newInstance();
PropertiesManager man = new PropertiesManager(object);
removeViewProperties(metaAggregate, values);
removeCalculatedFields(metaAggregate, values); // THIS LINE FIX THIS BUG
values = convertSubmapsInObject(metaAggregate, values, false);
man.executeSets(values);
return object;
} catch (ClassNotFoundException ex) {
...