KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > legacy > Vetoer


1 //$Id: Vetoer.java,v 1.1 2004/09/26 05:18:26 oneovthafew Exp $
2
package org.hibernate.test.legacy;
3
4 import java.io.Serializable JavaDoc;
5
6 import org.hibernate.CallbackException;
7 import org.hibernate.Session;
8 import org.hibernate.classic.Lifecycle;
9
10 public class Vetoer implements Lifecycle {
11
12     boolean onSaveCalled;
13     boolean onUpdateCalled;
14     boolean onDeleteCalled;
15
16     private String JavaDoc name;
17     private String JavaDoc[] strings;
18
19     public boolean onSave(Session s) throws CallbackException {
20         boolean result = !onSaveCalled;
21         onSaveCalled = true;
22         return result;
23     }
24
25     public boolean onUpdate(Session s) throws CallbackException {
26         boolean result = !onUpdateCalled;
27         onUpdateCalled = true;
28         return result;
29     }
30
31     public boolean onDelete(Session s) throws CallbackException {
32         boolean result = !onDeleteCalled;
33         onDeleteCalled = true;
34         return result;
35     }
36
37     public void onLoad(Session s, Serializable JavaDoc id) {}
38
39     public String JavaDoc getName() {
40         return name;
41     }
42
43     public void setName(String JavaDoc name) {
44         this.name = name;
45     }
46
47     public String JavaDoc[] getStrings() {
48         return strings;
49     }
50
51     public void setStrings(String JavaDoc[] strings) {
52         this.strings = strings;
53     }
54
55 }
56
57
58
59
60
61
62
Popular Tags