-->
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.  [ 4 posts ] 
Author Message
 Post subject: Is it possible to catch the DELETE-Event of hibernate
PostPosted: Sun Apr 17, 2005 3:17 pm 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo,
is there any possibility to catch the DELETE-Event of hibernate?

My problem is the follwing:
i have some reference counters in the objects, which are counting the refernces pointing to this object. If I now delete an object, i have to decrease some of these counters.
If i could catch the Delete-Event i could decrease the counters automatically.

Tanks for help!
Regards,
Martin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 17, 2005 5:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look at Interceptor

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 11:01 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Something like this?

protected void postProcessConfiguration(Configuration config) throws HibernateException {
config.setListener("delete", new BasicDeleteEventListener());
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 11:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
thats another more lowlevel and Hibernate 3 only thing.

Will also work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.