[jboss-user] [EJB 3.0] - Re: Looking up a PU from @PersistenceContext annotation

2009-01-07 Thread pete.m...@jboss.org
Also, I have full access to MC at this point, so what I'm doing for @EJB 
injection is to lookup the EjbReferenceResolver MC bean and use it to get the 
JNDI name for the injection point.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4200151#4200151

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4200151
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Looking up a PU from @PersistenceContext annotation

2009-01-07 Thread wolfc
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=bbop=viewtopicp=4200154#4200154

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4200154
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user