Hi, I have a problem with NHibernate loading too much data.
I have classes with an Id property, there are some many-to-one relationships based on an the Id. So for example a Country has a Currency. I have a table of Countries and one of Currencies and there is a CurrencyId column in the Country table, nice and simple. I load all the Currencies into memory, I then load all the Countries, this will create a Currency object for that Country. Since it is lazy-load the Currency object isn't populated. To test if 2 currencies are equal I compare Ids, this causes the whole currency to be loaded. That isn't what I want since the test can be much later than the query (the Session is gone). The CurrencyId should already be loaded since it is the foreign key, I would think that it would have to be loaded when the Country is. Is there any way of telling NHibernate to return the Id value of the Currency object to me without loading the whole object? Thanks, Vincent -- 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.
