These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: IInterceptor OnLoad is not called by ISession.CreateCriteria
PostPosted: Wed Oct 22, 2008 10:04 am 
Newbie

Joined: Wed Oct 22, 2008 8:37 am
Posts: 4
Location: Belgium
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.