Hi folks, should an child entity collection be automatically updated
after a Save()?

I'll try to explain the problem in a sample:

Product -> CalendarGroup -> CalendarDay
(Many) -> (One) -> (Many)

This way, a product has a calendarGroup, and this calendarGroup has a
collection (Bag) of calendarDay.
In code, if I have a product entity, I can read some calendarDay by
using: myProduct.CalendarGroup.CalendarDay.First();

The problem: that product is already loaded in memory, and, after I
add some day in CalendarDay using the Session, the
CalendarGroup.CalendarDay of that product isn't updated.

Does NHibernate have a method to update (in memory, not in database)
some children collection?
I tried the following methods:

Session.Persist(product);
Session.Refresh(product);
Session.Flush();
Session.Update(product);

In all these cases, the children collection was not updated, in other
words, the calendarDay I added in database was not visible to that
product entity.

All my mapping are lazy enabled.. and if you need some code to
understand this problem, let me know.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to