Hello again,
no answer, nobody knows or is it such a stupid question as it doesn't worth the effort?
Well, meantime I found that if I get the CollectionMappings list after the session is opened, the Key property (or getKey () in Hibernate) is no more null. Below are the lines I used, I need a sorted list of these collections, that's why I copy the CollectionMapping list in a sorted list.
(I use NHibernate, I forgot to mention, and the NHibernate 2.0 library)
<<
ISession s = SessionFactory.OpenSession();
m_sortedCollectionsByChildName = new List<Collection>(Config.CollectionMappings);
(m_sortedCollectionsByChildName as List<Collection>).Sort(new CollectionByChildComparer());
s.Close();
>>
If I remove the first and last lines (opening and closing the session), the Key property of every Collection object in the Config.CollectionMappings list is null. (the Config object is initialized as "new Configuration().Configure();")
Does anybody knows why the session must be opened in order to have the Collection.Key property not null? This way an extra time is introduced to connect to the session. CollectionMappings list should be part of metadata so it shouldn't have to connect to the session in order to create this property.
Thanks,
Bogdan
|