public int compareEntitysWithRespectToProperties ( Entity entity1 , Entity entity2 ) { List < SortKeyType > sortKeys = sortControl . getSortKeys ( ) ; int temp = 0 ; for ( int i = 0 ; i < sortKeys . size ( ) && temp == 0 ; i ++ ) { SortKeyType sortKey = ( SortKeyType ) sortKeys . get ( i ) ; String propName = sortKey . getPropertyName ( ) ; boolean ascendingSorting = sortKey . isAscendingOrder ( ) ; Object propValue1 = getPropertyValue ( entity1 , propName , ascendingSorting ) ; Object propValue2 = getPropertyValue ( entity2 , propName , ascendingSorting ) ; temp = compareProperties ( propValue1 , propValue2 ) ; if ( ! ascendingSorting ) { temp = 0 - temp ; } } return temp ; }
Compares the two entity data objects .