This content has been marked as final.
Show 1 reply
-
1. Re: How to use the entity query framework to model the following query
njrich28 Aug 30, 2010 3:30 PM (in response to josdaniel)Presuming you are defining your framework query in components.xml, something like this:
<framework:entity-query> <framework:ejbql>select user from User user where user.points is not null</framework:ejbql> <framework:restrictions> <value>user.appointmentDate < #{currentDate}</value> </framework:restrictions> </framework:entity-query>
The 'static' restrictions in the query (ie does not depend on something that changes like the current date) should be defined in the ejbql attribute or tag. The 'dynamic' part of the restriction should be included in the restrictions tag. Each value should have one expression language element (#{currentDate} in this case). You can have any number of value tags inside a restriction.
currentDate is a built-in Seam component that evaluates to a new Date(). There's also currentDatetime.