01: //$Id: EmptyInterceptor.java 7859 2005-08-11 21:57:33Z oneovthafew $
02: package org.hibernate;
03:
04: import java.io.Serializable;
05: import java.util.Iterator;
06:
07: import org.hibernate.type.Type;
08:
09: /**
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 {
16:
17: public static final Interceptor INSTANCE = new EmptyInterceptor();
18:
19: protected EmptyInterceptor() {
20: }
21:
22: public void onDelete(Object entity, Serializable id,
23: Object[] state, String[] propertyNames, Type[] types) {
24: }
25:
26: public boolean onFlushDirty(Object entity, Serializable id,
27: Object[] currentState, Object[] previousState,
28: String[] propertyNames, Type[] types) {
29: return false;
30: }
31:
32: public boolean onLoad(Object entity, Serializable id,
33: Object[] state, String[] propertyNames, Type[] types) {
34: return false;
35: }
36:
37: public boolean onSave(Object entity, Serializable id,
38: Object[] state, String[] propertyNames, Type[] types) {
39: return false;
40: }
41:
42: public void postFlush(Iterator entities) {
43: }
44:
45: public void preFlush(Iterator entities) {
46: }
47:
48: public Boolean isTransient(Object entity) {
49: return null;
50: }
51:
52: public Object instantiate(String entityName, EntityMode entityMode,
53: Serializable id) {
54: return null;
55: }
56:
57: public int[] findDirty(Object entity, Serializable id,
58: Object[] currentState, Object[] previousState,
59: String[] propertyNames, Type[] types) {
60: return null;
61: }
62:
63: public String getEntityName(Object object) {
64: return null;
65: }
66:
67: public Object getEntity(String entityName, Serializable id) {
68: return null;
69: }
70:
71: public void afterTransactionBegin(Transaction tx) {
72: }
73:
74: public void afterTransactionCompletion(Transaction tx) {
75: }
76:
77: public void beforeTransactionCompletion(Transaction tx) {
78: }
79:
80: public String onPrepareStatement(String sql) {
81: return sql;
82: }
83:
84: public void onCollectionRemove(Object collection, Serializable key)
85: throws CallbackException {
86: }
87:
88: public void onCollectionRecreate(Object collection, Serializable key)
89: throws CallbackException {
90: }
91:
92: public void onCollectionUpdate(Object collection, Serializable key)
93: throws CallbackException {
94: }
95:
96: }
|