Hello,
As i mentioned at the mail subject, i am having problem with not mutable
map inside BasicDynaBean.
As far as i know, it is the default behaviour of this map.
What i would like to do is, simply retrieve the resultset from db which
will create a list including DynaBeans.
For viewing the database table, everything works fine, the problem occurs
when i try to edit it and i get the following exception:
Caused by: javax.el.PropertyNotWritableException
at javax.el.MapELResolver.setValue(MapELResolver.java:267)
at
com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
at
com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
at com.sun.el.parser.AstValue.setValue(AstValue.java:201)
at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:291)
at
com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
... 50 more
I assume, this is because of the map inside dyna bean is not mutable.
I think one option is to change the default behaviour of the map by editing
the source code of BeanUtils library.
On the other hand, i think the implementors of this library must have
thought this functionality somehow...
Below is the code snippet that i use for retrieving the result set as
DynaBeans.
String query = "SELECT * FROM test.a";
Statement stmt = (Statement) con.createStatement();
ResultSet rs = stmt.executeQuery(query);
RowSetDynaClass rsdc = new RowSetDynaClass(rs);
rs.close();
stmt.close();
dynaObjectList= rsdc.getRows();
I tried to use LazyDynaMap as well, editing the table worked fine but the
Map didnt allow me to put multiple data since the key is not unique for
other datasets.
Because the key is the property name.
I would be really appreciated if you suggest me hints.
Thanks in advance.
I am really looking forward to see the answers if possible.
Best regards.
Ercan CANLIER