26
26
import java .io .Serializable ;
27
27
import java .util .Iterator ;
28
28
29
- import org .hibernate .resource .jdbc .spi .StatementInspector ;
30
29
import org .hibernate .type .Type ;
31
30
32
31
/**
@@ -71,7 +70,7 @@ public interface Interceptor {
71
70
*
72
71
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
73
72
*/
74
- public boolean onLoad (Object entity , Serializable id , Object [] state , String [] propertyNames , Type [] types ) throws CallbackException ;
73
+ boolean onLoad (Object entity , Serializable id , Object [] state , String [] propertyNames , Type [] types ) throws CallbackException ;
75
74
76
75
/**
77
76
* Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected
@@ -94,7 +93,13 @@ public interface Interceptor {
94
93
*
95
94
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
96
95
*/
97
- public boolean onFlushDirty (Object entity , Serializable id , Object [] currentState , Object [] previousState , String [] propertyNames , Type [] types ) throws CallbackException ;
96
+ boolean onFlushDirty (
97
+ Object entity ,
98
+ Serializable id ,
99
+ Object [] currentState ,
100
+ Object [] previousState ,
101
+ String [] propertyNames ,
102
+ Type [] types ) throws CallbackException ;
98
103
99
104
/**
100
105
* Called before an object is saved. The interceptor may modify the <tt>state</tt>, which will be used for
@@ -110,7 +115,7 @@ public interface Interceptor {
110
115
*
111
116
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
112
117
*/
113
- public boolean onSave (Object entity , Serializable id , Object [] state , String [] propertyNames , Type [] types ) throws CallbackException ;
118
+ boolean onSave (Object entity , Serializable id , Object [] state , String [] propertyNames , Type [] types ) throws CallbackException ;
114
119
115
120
/**
116
121
* Called before an object is deleted. It is not recommended that the interceptor modify the <tt>state</tt>.
@@ -123,7 +128,7 @@ public interface Interceptor {
123
128
*
124
129
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
125
130
*/
126
- public void onDelete (Object entity , Serializable id , Object [] state , String [] propertyNames , Type [] types ) throws CallbackException ;
131
+ void onDelete (Object entity , Serializable id , Object [] state , String [] propertyNames , Type [] types ) throws CallbackException ;
127
132
128
133
/**
129
134
* Called before a collection is (re)created.
@@ -133,7 +138,7 @@ public interface Interceptor {
133
138
*
134
139
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
135
140
*/
136
- public void onCollectionRecreate (Object collection , Serializable key ) throws CallbackException ;
141
+ void onCollectionRecreate (Object collection , Serializable key ) throws CallbackException ;
137
142
138
143
/**
139
144
* Called before a collection is deleted.
@@ -143,7 +148,7 @@ public interface Interceptor {
143
148
*
144
149
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
145
150
*/
146
- public void onCollectionRemove (Object collection , Serializable key ) throws CallbackException ;
151
+ void onCollectionRemove (Object collection , Serializable key ) throws CallbackException ;
147
152
148
153
/**
149
154
* Called before a collection is updated.
@@ -153,7 +158,7 @@ public interface Interceptor {
153
158
*
154
159
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
155
160
*/
156
- public void onCollectionUpdate (Object collection , Serializable key ) throws CallbackException ;
161
+ void onCollectionUpdate (Object collection , Serializable key ) throws CallbackException ;
157
162
158
163
/**
159
164
* Called before a flush.
@@ -162,7 +167,7 @@ public interface Interceptor {
162
167
*
163
168
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
164
169
*/
165
- public void preFlush (Iterator entities ) throws CallbackException ;
170
+ void preFlush (Iterator entities ) throws CallbackException ;
166
171
167
172
/**
168
173
* Called after a flush that actually ends in execution of the SQL statements required to synchronize
@@ -172,7 +177,7 @@ public interface Interceptor {
172
177
*
173
178
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
174
179
*/
175
- public void postFlush (Iterator entities ) throws CallbackException ;
180
+ void postFlush (Iterator entities ) throws CallbackException ;
176
181
177
182
/**
178
183
* Called to distinguish between transient and detached entities. The return value determines the
@@ -186,7 +191,7 @@ public interface Interceptor {
186
191
* @param entity a transient or detached entity
187
192
* @return Boolean or <tt>null</tt> to choose default behaviour
188
193
*/
189
- public Boolean isTransient (Object entity );
194
+ Boolean isTransient (Object entity );
190
195
191
196
/**
192
197
* Called from <tt>flush()</tt>. The return value determines whether the entity is updated
@@ -207,7 +212,13 @@ public interface Interceptor {
207
212
*
208
213
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
209
214
*/
210
- public int [] findDirty (Object entity , Serializable id , Object [] currentState , Object [] previousState , String [] propertyNames , Type [] types );
215
+ int [] findDirty (
216
+ Object entity ,
217
+ Serializable id ,
218
+ Object [] currentState ,
219
+ Object [] previousState ,
220
+ String [] propertyNames ,
221
+ Type [] types );
211
222
/**
212
223
* Instantiate the entity class. Return <tt>null</tt> to indicate that Hibernate should use
213
224
* the default constructor of the class. The identifier property of the returned instance
@@ -221,7 +232,7 @@ public interface Interceptor {
221
232
*
222
233
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
223
234
*/
224
- public Object instantiate (String entityName , EntityMode entityMode , Serializable id ) throws CallbackException ;
235
+ Object instantiate (String entityName , EntityMode entityMode , Serializable id ) throws CallbackException ;
225
236
226
237
/**
227
238
* Get the entity name for a persistent or transient instance.
@@ -232,7 +243,7 @@ public interface Interceptor {
232
243
*
233
244
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
234
245
*/
235
- public String getEntityName (Object object ) throws CallbackException ;
246
+ String getEntityName (Object object ) throws CallbackException ;
236
247
237
248
/**
238
249
* Get a fully loaded entity instance that is cached externally.
@@ -244,7 +255,7 @@ public interface Interceptor {
244
255
*
245
256
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
246
257
*/
247
- public Object getEntity (String entityName , Serializable id ) throws CallbackException ;
258
+ Object getEntity (String entityName , Serializable id ) throws CallbackException ;
248
259
249
260
/**
250
261
* Called when a Hibernate transaction is begun via the Hibernate <tt>Transaction</tt>
@@ -253,21 +264,21 @@ public interface Interceptor {
253
264
*
254
265
* @param tx The Hibernate transaction facade object
255
266
*/
256
- public void afterTransactionBegin (Transaction tx );
267
+ void afterTransactionBegin (Transaction tx );
257
268
258
269
/**
259
270
* Called before a transaction is committed (but not before rollback).
260
271
*
261
272
* @param tx The Hibernate transaction facade object
262
273
*/
263
- public void beforeTransactionCompletion (Transaction tx );
274
+ void beforeTransactionCompletion (Transaction tx );
264
275
265
276
/**
266
277
* Called after a transaction is committed or rolled back.
267
278
*
268
279
* @param tx The Hibernate transaction facade object
269
280
*/
270
- public void afterTransactionCompletion (Transaction tx );
281
+ void afterTransactionCompletion (Transaction tx );
271
282
272
283
/**
273
284
* Called when sql string is being prepared.
@@ -278,5 +289,5 @@ public interface Interceptor {
278
289
* to inspect and alter SQL statements.
279
290
*/
280
291
@ Deprecated
281
- public String onPrepareStatement (String sql );
292
+ String onPrepareStatement (String sql );
282
293
}
0 commit comments