private static void validateOrderBy ( Attribute attr , Sort orderBy ) { if ( orderBy != null ) { EntityType refEntity = attr . getRefEntity ( ) ; if ( refEntity != null ) { for ( Sort . Order orderClause : orderBy ) { String refAttrName = orderClause . getAttr ( ) ; if ( refEntity . getAttribute ( refAttrName ) == null ) { throw new MolgenisDataException ( format ( "Unknown entity [%s] attribute [%s] referred to by entity [%s] attribute [%s] sortBy [%s]" , refEntity . getId ( ) , refAttrName , attr . getEntityType ( ) . getId ( ) , attr . getName ( ) , orderBy . toSortString ( ) ) ) ; } } } } }
Validate whether the attribute names defined by the orderBy attribute point to existing attributes in the referenced entity .