Removing withEntityManager from queries