Thanks for your reply, but either I can't apply that correctly to my mappings or it's the wrong approach.
I'll try to clearify what I need:
I have a entity LocalizationElement which has a map (IDictionary<int, string>) of Localizations. Now I know that I'll access a single Localization in this map with the given LanguageID like the following line shows:
Code:
return localizationElement.LocalizationsDictionary[languageID];
This line of code results in no additional select statements if I join fetch the whole map in my HQL query. But because I only need this one element in the dictionary all other elements which are loaded too are wasted performance.
If I don't join fetch the map in my HQL query a additional SQL statement is executed which loads
all Localizations into the map. So again all other elements are wasted performance.
It would be great if I could access a element in the dictionary without the need to load all other elements from the database. And that one element should be fetched in my initial HQL query so no additional SQL statement is needed when I access it.
So that's the question: Is it possible to configure NHibernate so it doesn't load the whole map if I access a specific element in the map?