I managed to persist the subentities now. I had made the following mistake:
I had returned a new list of sub-entities in the generator method for the 
DataModel. Now I returned a direct reference to the list hosted by the parent 
entity (instance.getParameterSettings after 
instance.setParameterSettings(newList)). 

This is great. However, there is one small thing left to ask. 

As I am displaying a list of sub-entities that do not yet have to exist, Seam 
creates the whole list of sub-entities when I do em.merge. Even those where I 
did not enter any values. This is understandable. However, we would need those 
sub-entities where nothing is entered NOT to be created. 

I tried to remove those sub-entities from the list (iterate over the list in 
the update method, check for setting stringlenght = 0, removed this item from 
list), but even though the new list (which i have saved to the parent entity 
using instance.setParameterSettings(newList)) has less entries, ALL 
sub-entities are present in the DB after the em.merge. 

How does Seam know and persist the sub-entities although I have removed them? 
Can I tell Seam not to persist certain sub-entities? Where would I have to 
remove them from the list?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015742#4015742

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015742
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to