getEntityManager is depecrated