After injecting PersistenceUnitDependencyResolver, this piece of pseudo code should do the
trick:
String beanName =
persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(deploymentUnit,
persistenceUnitName);
| PersistenceUnitDeployment deployment = lookup(beanName);
| ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory();
| return new InjectedEntityManagerFactory(managedFactory);
Although PersistenceUnitDeployment is an internal. Maybe we should add a simple utility
class to jpa-deployers.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200154#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...