Fix overriding hierarchy on buildQuery* methods