At the moment you can inject an EntityQuery into a component

@Name("foo")
  | public class Foo {
  | 
  |    @In(create=true)
  |    private EntityQuery barQuery;
  | 
  |    ...
  | 
  |    public void foo() {
  |       Iterator it = barQuery.getResultList().getIterator();
  |       while (it.hasNext()) {
  |          Bar bar = (Bar) it.next();
  |          ...
  |       }
  |    }
  | 
  | }

but it would be much neater (IMO) if you could just inject the results of the 
query

@Name("foo")
  | public class Foo {
  | 
  |    @In(create=true, value="barQuery.resultList")
  |    private List<Bar> bars;
  | 
  |    ...
  | 
  |    public void foo() {
  |       for (Bar bar : bars) {
  |          ...
  |       }
  |    }
  | 
  | }

Am I missing an obvious way to do this?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003774#4003774

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003774
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to