-
1. Re: query object question...
pmuir Jan 3, 2008 1:42 PM (in response to madhav_inamti)Post the actual xml you are using using code tags.
-
2. Re: query object question...
madhav_inamti Jan 3, 2008 1:58 PM (in response to madhav_inamti)Pete,
Here's the query...<framework:entity-query name="myFoo" ejbql="from Foo f, FooMap fm"> <framework:restrictions> <value>f.fooid=fm.fooid</value> <value>f.user=#{listItem.cUser}</value> </framework:restrictions> </framework:entity-query>
It says for 'f.fooid=fm.fooid' that atleast one value binding is required.
Also, if listItem is the seam object and cUser is a variable and has getCUser as a method, how do I use it in the query if cUser has not been outjected.
My final question is how do I access myFoo in the listItem object?
Thanks,
M -
3. Re: query object question...
pmuir Jan 3, 2008 2:04 PM (in response to madhav_inamti)the join restriction should be placed in the where clause of the ejbql, not as a restriction.
-
4. Re: query object question...
madhav_inamti Jan 3, 2008 2:16 PM (in response to madhav_inamti)Thanks, Pete
There are two more questions.
1. How do I access a variable in an object in the xml. Do I need to outject it to use it as EL ?
2. How do I use the named query in the object ?
Thanks,
M -
5. Re: query object question...
pmuir Jan 3, 2008 2:18 PM (in response to madhav_inamti)1) Yes, it needs to available via EL
2) You can't -
6. Re: query object question...
madhav_inamti Jan 3, 2008 2:27 PM (in response to madhav_inamti)Pete,
Thanks for your prompt reply.
I have a somewhat related question. I have implemented pagination with a data table. However, my data does not refresh when a database update happens.
Do I need to do anything specific for it to happen automatically. I have a refresh link which the user can use to reload, however this is not a nice way of doing it.
Any suggestions.
Thanks,
M -
7. Re: query object question...
pmuir Jan 3, 2008 2:29 PM (in response to madhav_inamti)Do you mean refresh when you page?
How have you implemented paging? Using EntityQuery as discussed in the ref manual? -
8. Re: query object question...
madhav_inamti Jan 3, 2008 2:57 PM (in response to madhav_inamti)Not when I page. If updates happen to the DB and it shows in the data table.
I implemented my own pagination scheme as my ejbql uses some local objects. I did not want to outject them.
Is using EntityQuery the most efficient ? Are there any performance advantages ?
Thanks,
M -
9. Re: query object question...
pmuir Jan 3, 2008 3:01 PM (in response to madhav_inamti)I'm lost as to what isn't refreshing when.
EntityQuery was carefully written to support this kind of thing. -
10. Re: query object question...
madhav_inamti Jan 4, 2008 5:00 PM (in response to madhav_inamti)I have a list. The list has 3 entries.
I add another entry on a different page.
I come back to the list. The list has 3 entries.
I am using an object that extends EntityQuery.
Thanks,
M -
11. Re: query object question...
pmuir Jan 5, 2008 8:07 AM (in response to madhav_inamti)Come back? How?
-
12. Re: query object question...
madhav_inamti Jan 5, 2008 2:57 PM (in response to madhav_inamti)come back by redirect defined in pages.xml.
<page view-id="/addfoo.xhtml" login-required="true" action="#{foo.createFoo}"> <navigation from-action="#{identity.logout}"> <redirect view-id="/home.xhtml"/> </navigation> <navigation from-action="#{foo.confirm}"> <redirect view-id="/listFoo.xhtml"/> </navigation> </page>
listFoo is not updated with latest entry. Is there a way I can make it hapen ?
Thanks,
M -
13. Re: query object question...
pmuir Jan 6, 2008 4:28 PM (in response to madhav_inamti)Lets see the object which extends EntityQuery.