Query constructor with EntityManager provided