Author: pete.muir(a)jboss.org
Date: 2009-01-08 11:49:29 -0500 (Thu, 08 Jan 2009)
New Revision: 833
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
Log:
support injection of @PersistenceContext into setters
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-08
16:49:10 UTC (rev 832)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-08
16:49:29 UTC (rev 833)
@@ -238,9 +238,16 @@
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);
+ }
}
/**
Show replies by date