Why is the OnLoad method of the IInterceptor only called as a consequence of ISession.Load(object id), and not as a consequence of ISession.CreateCriteria(typeof(T))?
I want to change the state of each object loaded from database so that the object graph always points to objects that are already in memory, rather than introducing duplicates. The OnLoad method of the IInterceptor:
public bool OnLoad(object entity, object id, object[] state, string[] propertyNames, IType[] types)
provides the state of each loaded object as an object[]. Unfortunately, OnLoad is not called when objects are fetched via ISession.CreateCriteria(typeof(T)).
NHibernate version: 2.0
_________________ Peter Rigole
Qmino BVBA
http://www.qmino.com
|