Moved display query generation to QueryAdapter.