protected Query buildPrefetchQuery ( Collection ids ) { CollectionDescriptor cds = getCollectionDescriptor ( ) ; QueryByCriteria query = buildPrefetchQuery ( ids , cds . getForeignKeyFieldDescriptors ( getItemClassDescriptor ( ) ) ) ; // check if collection must be ordered if ( ! cds . getOrderBy ( ) . isEmpty ( ) ) { Iterator iter = cds . getOrderBy ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { query . addOrderBy ( ( FieldHelper ) iter . next ( ) ) ; } } return query ; }
Build the query to perform a batched read get orderBy settings from CollectionDescriptor