converted EntityManager from scala to java.