query updated with the new jpql system