Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
/*
2
 * Hibernate, Relational Persistence for Idiomatic Java
3
 *
4
 * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
5
 * indicated by the @author tags or express copyright attribution
6
 * statements applied by the authors.  All third-party contributions are
7
 * distributed under license by Red Hat Middleware LLC.
8
 *
9
 * This copyrighted material is made available to anyone wishing to use, modify,
10
 * copy, or redistribute it subject to the terms and conditions of the GNU
11
 * Lesser General Public License, as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
16
 * for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this distribution; if not, write to:
20
 * Free Software Foundation, Inc.
21
 * 51 Franklin Street, Fifth Floor
22
 * Boston, MA  02110-1301  USA
23
 *
24
 */
25
package org.hibernate;
26
 
27
import java.io.Serializable;
28
import java.util.Iterator;
29
 
30
import org.hibernate.type.Type;
31
 
32
/**
33
 * An interceptor that does nothing. May be used as a base class
34
 * for application-defined custom interceptors.
35
 *
36
 * @author Gavin King
37
 */
38
public class EmptyInterceptor implements Interceptor, Serializable {
39
 
40
        public static final Interceptor INSTANCE = new EmptyInterceptor();
41
 
42
        protected EmptyInterceptor() {}
43
 
44
        public void onDelete(
45
                        Object entity,
46
                        Serializable id,
47
                        Object[] state,
48
                        String[] propertyNames,
49
                        Type[] types) {}
50
 
51
        public boolean onFlushDirty(
52
                        Object entity,
53
                        Serializable id,
54
                        Object[] currentState,
55
                        Object[] previousState,
56
                        String[] propertyNames,
57
                        Type[] types) {
58
                return false;
59
        }
60
 
61
        public boolean onLoad(
62
                        Object entity,
63
                        Serializable id,
64
                        Object[] state,
65
                        String[] propertyNames,
66
                        Type[] types) {
67
                return false;
68
        }
69
 
70
        public boolean onSave(
71
                        Object entity,
72
                        Serializable id,
73
                        Object[] state,
74
                        String[] propertyNames,
75
                        Type[] types) {
76
                return false;
77
        }
78
 
79
        public void postFlush(Iterator entities) {}
80
        public void preFlush(Iterator entities) {}
81
 
82
        public Boolean isTransient(Object entity) {
83
                return null;
84
        }
85
 
86
        public Object instantiate(String entityName, EntityMode entityMode, Serializable id) {
87
                return null;
88
        }
89
 
90
        public int[] findDirty(Object entity,
91
                        Serializable id,
92
                        Object[] currentState,
93
                        Object[] previousState,
94
                        String[] propertyNames,
95
                        Type[] types) {
96
                return null;
97
        }
98
 
99
        public String getEntityName(Object object) {
100
                return null;
101
        }
102
 
103
        public Object getEntity(String entityName, Serializable id) {
104
                return null;
105
        }
106
 
107
        public void afterTransactionBegin(Transaction tx) {}
108
        public void afterTransactionCompletion(Transaction tx) {}
109
        public void beforeTransactionCompletion(Transaction tx) {}
110
 
111
        public String onPrepareStatement(String sql) {
112
                return sql;
113
        }
114
 
115
        public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {}
116
 
117
        public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {}
118
 
119
        public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {}
120
 
121
}