KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > event > def > DefaultPostLoadEventListener


1 //$Id: DefaultPostLoadEventListener.java,v 1.2 2005/02/22 03:09:34 oneovthafew Exp $
2
package org.hibernate.event.def;
3
4 import org.hibernate.classic.Lifecycle;
5 import org.hibernate.event.PostLoadEvent;
6 import org.hibernate.event.PostLoadEventListener;
7
8 /**
9  * Default implementation is a noop.
10  *
11  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
12  */

13 public class DefaultPostLoadEventListener extends AbstractEventListener implements PostLoadEventListener {
14     
15     public void onPostLoad(PostLoadEvent event) {
16         if ( event.getPersister().implementsLifecycle( event.getSession().getEntityMode() ) ) {
17             //log.debug( "calling onLoad()" );
18
( ( Lifecycle ) event.getEntity() ).onLoad( event.getSession(), event.getId() );
19         }
20
21     }
22 }
23
Popular Tags