I am trying to figure out the right way to do this. I have a
ContactVO which has a phones collection that is mapped as a read-only
association. In Hibernate we are using the mappedBy annotation and in
the database we have a contact_id columns which joins the ContactVO to
the PhoneVO table.
My actionscript ContactVO has a "contact.phones" collection which we
bind to a datagrid. It seems that if I do this when I create a new
PhoneVO:
ds = new DataService("phones");
ds.createItem(myNewPhoneVO);
..the PhoneVO is persisted in the database BUT the "phones" collection
in my ContactVO is not updated. However, if I refresh the application
OR refill my contacts collection then the new PhoneVO shows up as
expected. It seems as if one uses "createItem" on a read only
property then the associated collection does not get the pushed data.
Is this the expected behavior?
If so, it seems like I would have to always add the item to my
collection in order to persist it correctly. Is that the "right" way
to commit these read-only collections?
Thanks, Kevin