Is there a simple way to tell NHibernate explicitly what I want to cache?
In my domain model, I have a top level entity which is essentially fixed reference data. In some places I just get the data for this entity but not for its collections, in others, I get the full object graph. I want to cache all the entities in the 'simple' form for use in lists etc and load the full object graph where required and replace the 'simple' form in the cache with the fully loaded version whenever it is retrieved.
FYI:For use in the rest of the application, this entity has a flag called IsLoaded which is set by one of the methods that explicily loads the full object graph. This is a painfully slow process, so I only call it whenever it is really necessary and I cache it outside of NHibernate (using the web cache)... I would really like to implement this caching closer to the Repository/Data Access layer.
|