Closed GoogleCodeExporter closed 9 years ago
Here's a fixed version for the writemethod:
private Object readBean(Object obj)
{
try
{
BeanInfo info = Introspector.getBeanInfo(obj.getClass());
for (PropertyDescriptor pd : info.getPropertyDescriptors())
{
String propName = pd.getName();
if (!"class".equals(propName) && !"annotations".equals(propName) &&
!"hibernateLazyInitializer".equals(propName))
{
Object val = pd.getReadMethod().invoke(obj, null);
if (val != null)
{
Object newVal = translate(val, pd.getPropertyType());
Method writeMethod = pd.getWriteMethod();
if (writeMethod == null) {
if (Log.isDebug())
Log.getLogger("Endpoint.AMF").debug("No writemethod exists for property " +
pd.getName() + " in bean of class " + obj.getClass().toString() +
" - no changes from the client can be persisted to this property.");
}
else {
writeMethod.invoke(obj, newVal);
}
}
}
}
}
catch (Exception ex)
{
ex.printStackTrace();
throw new RuntimeException(ex);
}
return obj;
}
same kind of thing will apply for the read method.
Original comment by ryeb...@gmail.com
on 9 Aug 2008 at 7:19
Seriously, this needs to be fixed.
Original comment by davidtro...@gmail.com
on 4 Sep 2009 at 4:57
Persistence is handled using change messaging, instead of object graphs now.
Sending change messages on server-side read-only properties does not cause an
exception (since 2.0RC5).
Original comment by martypit...@gtempaccount.com
on 15 Mar 2011 at 3:18
Original issue reported on code.google.com by
ivan.yu....@gmail.com
on 25 Jun 2008 at 4:03