-->
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.  [ 2 posts ] 
Author Message
 Post subject: newbie question - onDelete() not called in interceptor
PostPosted: Thu Apr 06, 2006 8:15 pm 
Newbie

Joined: Wed Mar 22, 2006 6:30 am
Posts: 9
...have no idea why - seems i have the signature right... ...onSave() is called just fine. but when i successfully delete an object like:

Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
int deleted = session.createQuery("Delete net.sf.ussrp.bus.Report where id = "+ id) .executeUpdate();
tx.commit();
HibernateUtil.closeSession();

...onDelete() is not called in my interceptor, like:

public class UssrpInterceptor extends EmptyInterceptor {
...
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {}
...
}


Top
 Profile  
 
 Post subject: Re: newbie question - onDelete() not called in interceptor
PostPosted: Fri Apr 07, 2006 12:39 pm 
Newbie

Joined: Wed Mar 22, 2006 6:30 am
Posts: 9
gotta call "session.delete(report)" for the onDelete() interceptor call back to be called.

...means can't delete in batch if you need the call back? e.g. no:

int deleted = session.createQuery("Delete net.sf.ussrp.bus.Report").executeUpdate();

??

thanks,

tom


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

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.