modified Query to be able to get the supplied ObjectTypes