-
1. Re: OR-Relationship in EntityQuery
michaelschuetz Aug 13, 2008 9:13 AM (in response to michaelschuetz)OK - maybe I did not point out my issue exactly enough.
What ist the recommend way to manipulate how the ejbql is performed? So how to use restrictions with an logical OR??thanks a lot
Michael -
2. Re: OR-Relationship in EntityQuery
serkan.s.eskici.online.nl Aug 13, 2008 1:32 PM (in response to michaelschuetz)I need this feature too.
In my jsf page, I've an inputText where one can enter search terms for filtering all the data of my dataTable.
And unfortunatelly, I couldn't make this work.
I guess that my last option is to use HibernateSearch, but then I won't be able to make use of the paging feature of EntityQueries.
-
3. Re: OR-Relationship in EntityQuery
gcoelho2001 Sep 26, 2008 5:37 PM (in response to michaelschuetz)I have the same problem.
I would like to put my ORs inside an AND restriction, but EntityQuery currently does not support more than one value binding in a restriction
(https://jira.jboss.org/jira/browse/JBSEAM-1065).With that issue resolved, you could do something like:
xx = #{yy} OR xx = #{zz}
right ?
Another related problem is that EntityQuery requires one value binding per restriction, so you cannot use
is null
noris not null
in a restriction.. -
4. Re: OR-Relationship in EntityQuery
cyberanto Nov 25, 2008 6:37 PM (in response to michaelschuetz)In my current project Seam is not allowed yet (I have been using it before, what a step backwards!). We still hope in a future phase to change our technology stack (and include SEAM), so I decided to write some framework classes which copy certain parts of SEAMs API and allow the develoeprs to code
as if they had seam available
, and make our code immediatley usable once we switch to SEAM.One of the APIs I have created is EntityQuery (light :). Like in SEAM, the user can specify restrictions, and I had the same issues mentioned above:
(1) developers want more than one value binding: while I allow this, it comes with a big caveat: The restriction is usually removed from the query when the value binding returns null - i.e. no value for this e.g. search parameter is available, we do not want to include this feature. This is very different from specifically querying for a null value. If you have more than one value expression, what behaviour do you expect? Should the whole restriction disappear if just one value binding returns null (this is how my implementation works, but it is clearly an issue).
(2) I was considering adding
expansions
(as apposed to restrictions), which are OR-ed. After realizing that the order in which the ANDs and ORs are combined influences the outcome (e.g. http://oreilly.com/catalog/mastorasql/chapter/ch07.html), I decided not to do that. One still can use OR in subclauses within a restriction if necessary.This second point goes all the way back to the end-users: they had not thought about the effect the ordering of the filters has once one combines AND and OR clauses.