-
1. Re: Query repeated over and over
tszpinda Sep 5, 2008 4:20 PM (in response to skunk)Cos you do query in getter, which is called more then once, you should use a class which extends EntityQuery.
Look for examples and check http://seamframework.org/tag/EntityQuery
Tomek
-
2. Re: Query repeated over and over
skunk Sep 5, 2008 4:37 PM (in response to skunk)I am calling it three times, twice to check what should be rendered and once to put the results in the table. Not 34!If you use some other class system, JSF must be calling getters on it also.
Have I somehow created my dataTable wrongly such that it is getting the collection more than once every row?!
-
3. Re: Query repeated over and over
tszpinda Sep 5, 2008 4:53 PM (in response to skunk)Getters could be invoked multiple times during the life cycle... for more details use google.
-
-
5. Re: Query repeated over and over
sjmenden Sep 5, 2008 7:28 PM (in response to skunk)Like one of the previous posts said you can use EntityQuery, but if you don't want to change what you have, just add a null check to the getter.
-
6. Re: Query repeated over and over
accountclosed Sep 5, 2008 7:50 PM (in response to skunk)
Samuel Mendenhall wrote on Sep 05, 2008 19:28:
Like one of the previous posts said you can use EntityQuery, but if you don't want to change what you have, just add a null check to the getter.Use annotations
@Factory(value = "users", scope = ScopeType.PAGE)
See my post below ... it outlines this issue exactly.
-
7. Re: Query repeated over and over
skunk Sep 8, 2008 11:29 AM (in response to skunk)I printed something to the console, and like you said, the getter is being called by JSF over and over, not anything more underlying than that.
Thanks for your help,
Dave -
8. Re: Query repeated over and over
skunk Sep 8, 2008 11:37 AM (in response to skunk)That post was great, thanks for the link.
It's a shame JSF doesn't work in the more obvious way of actually using data it's given, but at least my site works now.
Dave