-->
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: Difference between Lifecycle and Interceptor Interfaces
PostPosted: Tue Oct 26, 2004 11:36 am 
Newbie

Joined: Mon Aug 30, 2004 9:54 am
Posts: 8
Hi,

A persistent class Product extends AbstractVersionedEntity which implements Lifecycle. I'd expect the methods onSave() and onUpdate() to be hit whenever the application saves or updates an instance, that's why I try to set an "edited" timestamp value among other values there.

Unfortunately, the methods never get executed. A short test program tells me:

Code:
      boolean test = Lifecycle.class.isAssignableFrom(Product.class);
      System.out.println("Result: " + test);



Result: true

What else needs to be implemented for the Lifecycle event handler to work as expected? I've read about the Interceptor Interface but this would spoil my application design, since the interceptor needs to be specified when the session is opened: The session is created by a class from a generic part of the portal application (servlet filter), and I'd like to avoid dependencies between the portal code and the actual entity model which belongs to separate package and project.


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.