@Bean public SharedEntityManagerBean getSharedEntityManager() { final SharedEntityManagerBean shared = new SharedEntityManagerBean(); shared.setEntityManagerFactory(getEntityManagerFactory()); return shared; }
@Bean public FactoryBean<EntityManager> entityManager(EntityManagerFactory emf) { SharedEntityManagerBean em = new SharedEntityManagerBean(); em.setEntityManagerFactory(emf); return em; }
@Bean public SharedEntityManagerBean entityManager() { SharedEntityManagerBean em = new SharedEntityManagerBean(); em.setEntityManagerFactory(entityManagerFactory()); return em; }
@Bean public FactoryBean<EntityManager> entityManager() { final EntityManagerFactory entityManagerFactory = entityManagerFactory().getObject(); final SharedEntityManagerBean entityManagerBean = new SharedEntityManagerBean(); entityManagerBean.setEntityManagerFactory(entityManagerFactory); return entityManagerBean; }