genericise Query with the candidate class