@@ -72,11 +72,8 @@ public interface Interceptor {
72
72
* @param types The types of the entity properties, corresponding to the {@code state}.
73
73
*
74
74
* @return {@code true} if the user modified the {@code state} in any way.
75
- *
76
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
77
75
*/
78
- default boolean onLoad (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types )
79
- throws CallbackException {
76
+ default boolean onLoad (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types ) {
80
77
return false ;
81
78
}
82
79
@@ -94,13 +91,10 @@ default boolean onLoad(Object entity, Object id, Object[] state, String[] proper
94
91
*
95
92
* @return {@code true} if the user modified the {@code state} in any way.
96
93
*
97
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
98
- *
99
94
* @see Session#persist(Object)
100
95
* @see Session#merge(Object)
101
96
*/
102
- default boolean onPersist (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types )
103
- throws CallbackException {
97
+ default boolean onPersist (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types ) {
104
98
return onSave (entity , id , state , propertyNames , types );
105
99
}
106
100
@@ -115,12 +109,9 @@ default boolean onPersist(Object entity, Object id, Object[] state, String[] pro
115
109
* @param propertyNames The names of the entity properties.
116
110
* @param types The types of the entity properties
117
111
*
118
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
119
- *
120
112
* @see Session#remove(Object)
121
113
*/
122
- default void onRemove (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types )
123
- throws CallbackException {
114
+ default void onRemove (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types ) {
124
115
onDelete (entity , id , state , propertyNames , types );
125
116
}
126
117
@@ -143,8 +134,6 @@ default void onRemove(Object entity, Object id, Object[] state, String[] propert
143
134
*
144
135
* @return {@code true} if the user modified the {@code currentState} in any way.
145
136
*
146
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
147
- *
148
137
* @see Session#flush()
149
138
*/
150
139
default boolean onFlushDirty (
@@ -153,7 +142,7 @@ default boolean onFlushDirty(
153
142
Object [] currentState ,
154
143
Object [] previousState ,
155
144
String [] propertyNames ,
156
- Type [] types ) throws CallbackException {
145
+ Type [] types ) {
157
146
return false ;
158
147
}
159
148
@@ -171,16 +160,13 @@ default boolean onFlushDirty(
171
160
*
172
161
* @return {@code true} if the user modified the {@code state} in any way.
173
162
*
174
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
175
- *
176
163
* @see Session#persist(Object)
177
164
* @see Session#merge(Object)
178
165
*
179
166
* @deprecated Use {@link #onPersist(Object, Object, Object[], String[], Type[])}
180
167
*/
181
168
@ Deprecated (since = "6.6" )
182
- default boolean onSave (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types )
183
- throws CallbackException {
169
+ default boolean onSave (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types ) {
184
170
return false ;
185
171
}
186
172
@@ -195,67 +181,54 @@ default boolean onSave(Object entity, Object id, Object[] state, String[] proper
195
181
* @param propertyNames The names of the entity properties.
196
182
* @param types The types of the entity properties
197
183
*
198
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
199
- *
200
184
* @see Session#remove(Object)
201
185
*
202
186
* @deprecated Use {@link #onRemove(Object, Object, Object[], String[], Type[])}
203
187
*/
204
188
@ Deprecated (since = "6.6" )
205
- default void onDelete (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types )
206
- throws CallbackException {
189
+ default void onDelete (Object entity , Object id , Object [] state , String [] propertyNames , Type [] types ) {
207
190
}
208
191
209
192
/**
210
193
* Called before a collection is (re)created.
211
194
*
212
195
* @param collection The collection instance.
213
196
* @param key The collection key value.
214
- *
215
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
216
197
*/
217
- default void onCollectionRecreate (Object collection , Object key ) throws CallbackException {
198
+ default void onCollectionRecreate (Object collection , Object key ) {
218
199
}
219
200
220
201
/**
221
202
* Called before a collection is deleted.
222
203
*
223
204
* @param collection The collection instance.
224
205
* @param key The collection key value.
225
- *
226
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
227
206
*/
228
- default void onCollectionRemove (Object collection , Object key ) throws CallbackException {
207
+ default void onCollectionRemove (Object collection , Object key ) {
229
208
}
230
209
231
210
/**
232
211
* Called before a collection is updated.
233
212
*
234
213
* @param collection The collection instance.
235
214
* @param key The collection key value.
236
- *
237
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
238
215
*/
239
- default void onCollectionUpdate (Object collection , Object key ) throws CallbackException {
216
+ default void onCollectionUpdate (Object collection , Object key ) {
240
217
}
241
218
/**
242
219
* Called before a flush.
243
220
*
244
221
* @param entities The entities to be flushed.
245
- *
246
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
247
222
*/
248
- default void preFlush (Iterator <Object > entities ) throws CallbackException {}
223
+ default void preFlush (Iterator <Object > entities ) {}
249
224
250
225
/**
251
226
* Called after a flush that actually ends in execution of the SQL statements required to synchronize
252
227
* in-memory state with the database.
253
228
*
254
229
* @param entities The entities that were flushed.
255
- *
256
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
257
230
*/
258
- default void postFlush (Iterator <Object > entities ) throws CallbackException {}
231
+ default void postFlush (Iterator <Object > entities ) {}
259
232
260
233
/**
261
234
* Called to distinguish between transient and detached entities. The return value determines the
@@ -290,8 +263,6 @@ default Boolean isTransient(Object entity) {
290
263
* @param types The types of the entity properties
291
264
*
292
265
* @return array of dirty property indices or {@code null} to indicate Hibernate should perform default behaviour
293
- *
294
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
295
266
*/
296
267
default int [] findDirty (
297
268
Object entity ,
@@ -311,7 +282,7 @@ default int[] findDirty(
311
282
default Object instantiate (
312
283
String entityName ,
313
284
EntityRepresentationStrategy representationStrategy ,
314
- Object id ) throws CallbackException {
285
+ Object id ) {
315
286
return instantiate ( entityName , representationStrategy .getMode (), id );
316
287
}
317
288
@@ -323,7 +294,7 @@ default Object instantiate(
323
294
default Object instantiate (
324
295
String entityName ,
325
296
RepresentationMode representationMode ,
326
- Object id ) throws CallbackException {
297
+ Object id ) {
327
298
return null ;
328
299
}
329
300
@@ -334,11 +305,9 @@ default Object instantiate(
334
305
*
335
306
* @return the name of the entity
336
307
*
337
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
338
- *
339
308
* @see EntityNameResolver
340
309
*/
341
- default String getEntityName (Object object ) throws CallbackException {
310
+ default String getEntityName (Object object ) {
342
311
return null ;
343
312
}
344
313
@@ -349,10 +318,8 @@ default String getEntityName(Object object) throws CallbackException {
349
318
* @param id the instance identifier
350
319
*
351
320
* @return a fully initialized entity
352
- *
353
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
354
321
*/
355
- default Object getEntity (String entityName , Object id ) throws CallbackException {
322
+ default Object getEntity (String entityName , Object id ) {
356
323
return null ;
357
324
}
358
325
@@ -388,8 +355,6 @@ default void afterTransactionCompletion(Transaction tx) {}
388
355
* @param propertyNames The names of the entity properties.
389
356
* @param propertyTypes The types of the entity properties
390
357
*
391
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
392
- *
393
358
* @see StatelessSession#insert(Object)
394
359
*/
395
360
default void onInsert (Object entity , Object id , Object [] state , String [] propertyNames , Type [] propertyTypes ) {}
@@ -403,8 +368,6 @@ default void onInsert(Object entity, Object id, Object[] state, String[] propert
403
368
* @param propertyNames The names of the entity properties.
404
369
* @param propertyTypes The types of the entity properties
405
370
*
406
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
407
- *
408
371
* @see StatelessSession#update(Object)
409
372
*/
410
373
default void onUpdate (Object entity , Object id , Object [] state , String [] propertyNames , Type [] propertyTypes ) {}
@@ -418,8 +381,6 @@ default void onUpdate(Object entity, Object id, Object[] state, String[] propert
418
381
* @param propertyNames The names of the entity properties.
419
382
* @param propertyTypes The types of the entity properties
420
383
*
421
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
422
- *
423
384
* @see StatelessSession#upsert(String, Object)
424
385
*/
425
386
default void onUpsert (Object entity , Object id , Object [] state , String [] propertyNames , Type [] propertyTypes ) {}
@@ -432,8 +393,6 @@ default void onUpsert(Object entity, Object id, Object[] state, String[] propert
432
393
* @param propertyNames The names of the entity properties.
433
394
* @param propertyTypes The types of the entity properties
434
395
*
435
- * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
436
- *
437
396
* @see StatelessSession#delete(Object)
438
397
*/
439
398
default void onDelete (Object entity , Object id , String [] propertyNames , Type [] propertyTypes ) {}
0 commit comments