[jboss-user] [JBoss Seam] - Injecting Entity Queries into beans
petemuir
do-not-reply at jboss.com
Fri Jan 19 06:42:56 EST 2007
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
More information about the jboss-user
mailing list