1 | public static int[] findDirty(↵ | | 1 | public static int[] findModified(↵
|
2 | final StandardProperty[] properties,↵ | | 2 | final StandardProperty[] properties, ↵
|
3 | final Object[] currentState,↵ | | 3 | final Object[] currentState,↵
|
4 | final Object[] previousState,↵ | | 4 | final Object[] previousState,↵
|
5 | final boolean[][] includeColumns,↵ | | 5 | final boolean[][] includeColumns,↵
|
6 | final boolean anyUninitializedProperties,↵ | | 6 | final boolean anyUninitializedProperties,↵
|
7 | final SessionImplementor session) {↵ | | 7 | final SessionImplementor session) {↵
|
8 | int[] results = null;↵ | | 8 | int[] results = null;↵
|
9 | int count = 0;↵ | | 9 | int count = 0;↵
|
10 | int span = properties.length;↵ | | 10 | int span = properties.length;↵
|
|
11 | for ( int i = 0; i < span; i++ ) {↵ | | 11 | for ( int i = 0; i < span; i++ ) {↵
|
12 | final boolean dirty = currentState[i] != LazyPropertyInitializer.UNFETCHED_PROPERTY↵ | | 12 | final boolean modified = currentState[i]!=LazyPropertyInitializer.UNFETCHED_PROPERTY↵
|
13 | && properties[i].isDirtyCheckable( anyUninitializedProperties )↵ | | 13 | && properties[i].isDirtyCheckable(anyUninitializedProperties)↵
|
14 | && properties[i].getType().isDirty( previousState[i], currentState[i], includeColumns[i], session );↵ | | 14 | && properties[i].getType().isModified( previousState[i], currentState[i], includeColumns[i], session );↵
|
|
15 | if ( dirty ) {↵ | | 15 | if ( modified ) {↵
|
16 | if ( results == null ) {↵ | | 16 | if ( results == null ) {↵
|
17 | results = new int[span];↵ | | 17 | results = new int[span];↵
|
18 | }↵ | | 18 | }↵
|
19 | results[count++] = i;↵ | | 19 | results[count++] = i;↵
|
20 | }↵ | | 20 | }↵
|
21 | }↵ | | 21 | }↵
|
|
22 | if ( count == 0 ) {↵ | | 22 | if ( count == 0 ) {↵
|
23 | return null;↵ | | 23 | return null;↵
|
24 | }↵ | | 24 | }↵
|
25 | else {↵ | | 25 | else {↵
|
26 | int[] trimmed = new int[count];↵ | | 26 | int[] trimmed = new int[count];↵
|
27 | System.arraycopy( results, 0, trimmed, 0, count );↵ | | 27 | System.arraycopy( results, 0, trimmed, 0, count );↵
|
28 | return trimmed;↵ | | 28 | return trimmed;↵
|
29 | | | 29 |
|