KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: DefaultPreLoadEventListener.java,v 1.3 2005/05/27 03:53:59 oneovthafew Exp $
2
package org.hibernate.event.def;
3
4 import org.hibernate.event.PreLoadEvent;
5 import org.hibernate.event.PreLoadEventListener;
6 import org.hibernate.persister.entity.EntityPersister;
7
8 /**
9  * Called before injecting property values into a newly
10  * loaded entity instance.
11  *
12  * @author Gavin King
13  */

14 public class DefaultPreLoadEventListener extends AbstractEventListener implements PreLoadEventListener {
15     
16     public void onPreLoad(PreLoadEvent event) {
17         EntityPersister persister = event.getPersister();
18         event.getSession()
19             .getInterceptor()
20             .onLoad(
21                     event.getEntity(),
22                     event.getId(),
23                     event.getState(),
24                     persister.getPropertyNames(),
25                     persister.getPropertyTypes()
26             );
27     }
28     
29 }
30
Popular Tags