@@ -279,23 +279,49 @@ else if ( !types[i].isAssociationType() ) {
279
279
* @param includeColumns Columns to be included in the dirty checking, per property
280
280
* @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
281
281
* @param session The session from which the dirty check request originated.
282
- *
282
+ *
283
283
* @return Array containing indices of the dirty properties, or null if no properties considered dirty.
284
+ *
285
+ * @deprecated Use {org.hibernate.type.TypeHelper{@link #findDirty(NonIdentifierAttribute[], Object[], Object[], boolean[][], SharedSessionContractImplementor)} indtead
284
286
*/
287
+ @ Deprecated
285
288
public static int [] findDirty (
286
289
final NonIdentifierAttribute [] properties ,
287
290
final Object [] currentState ,
288
291
final Object [] previousState ,
289
292
final boolean [][] includeColumns ,
290
293
final boolean anyUninitializedProperties ,
291
294
final SharedSessionContractImplementor session ) {
295
+ return findDirty ( properties , currentState , previousState , includeColumns , session );
296
+ }
297
+
298
+ /**
299
+ * Determine if any of the given field values are dirty, returning an array containing
300
+ * indices of the dirty fields.
301
+ * <p/>
302
+ * If it is determined that no fields are dirty, null is returned.
303
+ *
304
+ * @param properties The property definitions
305
+ * @param currentState The current state of the entity
306
+ * @param previousState The baseline state of the entity
307
+ * @param includeColumns Columns to be included in the dirty checking, per property
308
+ * @param session The session from which the dirty check request originated.
309
+ *
310
+ * @return Array containing indices of the dirty properties, or null if no properties considered dirty.
311
+ */
312
+ public static int [] findDirty (
313
+ final NonIdentifierAttribute [] properties ,
314
+ final Object [] currentState ,
315
+ final Object [] previousState ,
316
+ final boolean [][] includeColumns ,
317
+ final SharedSessionContractImplementor session ) {
292
318
int [] results = null ;
293
319
int count = 0 ;
294
320
int span = properties .length ;
295
321
296
322
for ( int i = 0 ; i < span ; i ++ ) {
297
323
final boolean dirty = currentState [i ] != LazyPropertyInitializer .UNFETCHED_PROPERTY
298
- && properties [i ].isDirtyCheckable ( anyUninitializedProperties )
324
+ && properties [i ].isDirtyCheckable ()
299
325
&& properties [i ].getType ().isDirty ( previousState [i ], currentState [i ], includeColumns [i ], session );
300
326
if ( dirty ) {
301
327
if ( results == null ) {
@@ -330,7 +356,11 @@ public static int[] findDirty(
330
356
* @param session The session from which the dirty check request originated.
331
357
*
332
358
* @return Array containing indices of the modified properties, or null if no properties considered modified.
359
+ *
360
+ * @deprecated Use {@link #findModified(NonIdentifierAttribute[], Object[], Object[], boolean[][], boolean[], boolean, SharedSessionContractImplementor)}
361
+ * instead.
333
362
*/
363
+ @ Deprecated
334
364
public static int [] findModified (
335
365
final NonIdentifierAttribute [] properties ,
336
366
final Object [] currentState ,
@@ -339,14 +369,40 @@ public static int[] findModified(
339
369
final boolean [] includeProperties ,
340
370
final boolean anyUninitializedProperties ,
341
371
final SharedSessionContractImplementor session ) {
372
+ return findModified ( properties , currentState , previousState , includeColumns , includeProperties , session );
373
+ }
374
+
375
+ /**
376
+ * Determine if any of the given field values are modified, returning an array containing
377
+ * indices of the modified fields.
378
+ * <p/>
379
+ * If it is determined that no fields are dirty, null is returned.
380
+ *
381
+ * @param properties The property definitions
382
+ * @param currentState The current state of the entity
383
+ * @param previousState The baseline state of the entity
384
+ * @param includeColumns Columns to be included in the mod checking, per property
385
+ * @param includeProperties Array of property indices that identify which properties participate in check
386
+ * @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
387
+ * @param session The session from which the dirty check request originated.
388
+ *
389
+ * @return Array containing indices of the modified properties, or null if no properties considered modified.
390
+ **/
391
+ public static int [] findModified (
392
+ final NonIdentifierAttribute [] properties ,
393
+ final Object [] currentState ,
394
+ final Object [] previousState ,
395
+ final boolean [][] includeColumns ,
396
+ final boolean [] includeProperties ,
397
+ final SharedSessionContractImplementor session ) {
342
398
int [] results = null ;
343
399
int count = 0 ;
344
400
int span = properties .length ;
345
401
346
402
for ( int i = 0 ; i < span ; i ++ ) {
347
403
final boolean modified = currentState [ i ] != LazyPropertyInitializer .UNFETCHED_PROPERTY
348
404
&& includeProperties [ i ]
349
- && properties [ i ].isDirtyCheckable ( anyUninitializedProperties )
405
+ && properties [ i ].isDirtyCheckable ()
350
406
&& properties [ i ].getType ().isModified ( previousState [ i ], currentState [ i ], includeColumns [ i ], session );
351
407
if ( modified ) {
352
408
if ( results == null ) {
0 commit comments