KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > event > PersistEvent


1 //$Id: PersistEvent.java,v 1.3 2005/05/27 03:53:58 oneovthafew Exp $
2
package org.hibernate.event;
3
4
5
6 /**
7  * An event class for persist()
8  *
9  * @author Gavin King
10  */

11 public class PersistEvent extends AbstractEvent {
12
13     private Object JavaDoc object;
14     private String JavaDoc entityName;
15
16     public PersistEvent(String JavaDoc entityName, Object JavaDoc original, EventSource source) {
17         this(original, source);
18         this.entityName = entityName;
19     }
20
21     public PersistEvent(Object JavaDoc object, EventSource source) {
22         super(source);
23         if ( object == null ) {
24             throw new IllegalArgumentException JavaDoc(
25                     "attempt to create create event with null entity"
26             );
27         }
28         this.object = object;
29     }
30
31     public Object JavaDoc getObject() {
32         return object;
33     }
34
35     public void setObject(Object JavaDoc object) {
36         this.object = object;
37     }
38
39     public String JavaDoc getEntityName() {
40         return entityName;
41     }
42
43     public void setEntityName(String JavaDoc entityName) {
44         this.entityName = entityName;
45     }
46
47 }
48
Popular Tags