KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > EmptyInterceptor


1 //$Id: EmptyInterceptor.java,v 1.1 2005/05/14 17:42:03 oneovthafew Exp $
2
package org.hibernate;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.Iterator JavaDoc;
6
7 import org.hibernate.type.Type;
8
9 /**
10  * An interceptor that does nothing. May be used as a base class
11  * for application-defined custom interceptors.
12  *
13  * @author Gavin King
14  */

15 public class EmptyInterceptor implements Interceptor, Serializable JavaDoc {
16     
17     public static final Interceptor INSTANCE = new EmptyInterceptor();
18     
19     protected EmptyInterceptor() {}
20
21     public void onDelete(
22             Object JavaDoc entity,
23             Serializable JavaDoc id,
24             Object JavaDoc[] state,
25             String JavaDoc[] propertyNames,
26             Type[] types) {}
27
28     public boolean onFlushDirty(
29             Object JavaDoc entity,
30             Serializable JavaDoc id,
31             Object JavaDoc[] currentState,
32             Object JavaDoc[] previousState,
33             String JavaDoc[] propertyNames,
34             Type[] types) {
35         return false;
36     }
37
38     public boolean onLoad(
39             Object JavaDoc entity,
40             Serializable JavaDoc id,
41             Object JavaDoc[] state,
42             String JavaDoc[] propertyNames,
43             Type[] types) {
44         return false;
45     }
46
47     public boolean onSave(
48             Object JavaDoc entity,
49             Serializable JavaDoc id,
50             Object JavaDoc[] state,
51             String JavaDoc[] propertyNames,
52             Type[] types) {
53         return false;
54     }
55
56     public void postFlush(Iterator JavaDoc entities) {}
57     public void preFlush(Iterator JavaDoc entities) {}
58
59     public Boolean JavaDoc isTransient(Object JavaDoc entity) {
60         return null;
61     }
62
63     public Object JavaDoc instantiate(String JavaDoc entityName, EntityMode entityMode, Serializable JavaDoc id) {
64         return null;
65     }
66
67     public int[] findDirty(Object JavaDoc entity,
68             Serializable JavaDoc id,
69             Object JavaDoc[] currentState,
70             Object JavaDoc[] previousState,
71             String JavaDoc[] propertyNames,
72             Type[] types) {
73         return null;
74     }
75
76     public String JavaDoc getEntityName(Object JavaDoc object) {
77         return null;
78     }
79
80     public Object JavaDoc getEntity(String JavaDoc entityName, Serializable JavaDoc id) {
81         return null;
82     }
83
84     public void afterTransactionBegin(Transaction tx) {}
85     public void afterTransactionCompletion(Transaction tx) {}
86     public void beforeTransactionCompletion(Transaction tx) {}
87     
88 }
Popular Tags