Removing a child instance from a parent child list. - non L2 Caching
894859Nov 4 2011 — edited Nov 8 2011I have a parent Entity
Parent
{
int id
String name
@onetomany
List <Child> list
}
and a child Entity
Child
{
int id
String name
}
First, let me say, I have L2 cache turned off.
So lets say I have a parent record with three children and I want to remove child 2. I have found if you remove the child only in the EM then when you select the parent again, it shows the child still being there even though the child has been removed from the db. I liked only having to remove the child because its only one instance to pass and remove over the web. But with that said, how do I remove the entity our of the parents Children list so it no longer shows up in the front end in the list? I cant use the selected index in the front end because I sort the data.
Or is it better to save the state of Parent too? But if so, what if Parents Children is hundreds of records. Thats alot of overhead for one record to be deleted. Could use some help here. Thanks in advance.