Skip to content

Commit

Permalink
support injection of @PersistenceContext into setters
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@833 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Jan 8, 2009
1 parent 0d054da commit 57cb28a
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -238,8 +238,15 @@ protected void injectEjbAndCommonFields(T beanInstance)
for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(manager.getEjbResolver().getPersistenceContextAnnotation()))
{
InjectionPoint injectionPoint = new InjectionPointImpl(field, this, beanInstance);
Object persistenceContext = manager.getEjbResolver().resolvePersistenceUnit(injectionPoint, manager.getNaming());
field.inject(beanInstance, persistenceContext);
Object puInstance = manager.getEjbResolver().resolvePersistenceUnit(injectionPoint, manager.getNaming());
field.inject(beanInstance, puInstance);
}

for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(manager.getEjbResolver().getPersistenceContextAnnotation()))
{
InjectionPoint injectionPoint = new InjectionPointImpl(method, this, beanInstance);
Object puInstance = manager.getEjbResolver().resolvePersistenceUnit(injectionPoint, manager.getNaming());
method.invoke(beanInstance, puInstance);
}
}

Expand Down

0 comments on commit 57cb28a

Please sign in to comment.