It is too stupid but I cannot figure out how to load, modify and save a collection.
Exmple:
Code:
ITransaction transaction = session.BeginTransaction();
IList foos = session.CreateQuery("from foo").List(); // foos is just an ArryList,
// not a persistent collection!
foos.Add(new Foo());
session.SaveOrUpdate(foos);
transaction.Commit();
Remarks:
1. Collection (foos) in the real application changed not by me, but by data binding, so I do not know what has been changed, thus I do not want to save each Foo instance individually.
2. Collection (foos) does not mapped as propery (or field) of any class, but I can map it to class with name Registry for example, but this class must be static (or a singleton) and it does not persist in any database table at all, so it has no id.
Can anybody tell how to save modifyed collection or make mapping of it as a property of a not persistent class (without id).
Thanks.