First of all, I would like to say that from a professional point of view, that you should stay away from the Seam Entity/Query/Home framework.
You can read my comment on why you shouldn't use it here
If you however want to use it, you must know it is a trade off you are taking. It will make things go slower, however it is easier to use.
That said, let me try to answer your questions with some examples:
However, I've also seen some examples using a RESTRICTIONS array. How exactly is this used? Are the OR conditions or AND conditions?
Since Seam 2.2.0 (if I am not mistaken) you have the option to add RESTRICTIONS with OR/AND.
You can set this with the restrictionLogicOperator
operator in your view like this:
<ui:define name="label">Match</ui:define>
<h:selectOneRadio id="logic" value="#{myEnityQueryList.restrictionLogicOperator}" styleClass="radio">
<f:selectItem itemLabel="AND" itemValue="and"/>
<f:selectItem itemLabel="OR" itemValue="or"/>
</h:selectOneRadio>
This code should be a part of a form that is mapped against your EntityQuery object together with some RESTRICTIONS. The restrictions are used to filter the query so you can retrieve the correct resultset. For instance:
private static final String[] RESTRICTIONS = { "lower(person.name) like lower(concat(#{personList.person.name},'%'))"}
So if you have a name field in your form, you can type John
and it and it will add John%
to the query.
Can anyone give me some more detailed information as to how EntityQuery is intended to be used?
The EntityQuery is intended to be used together with some search form. You bind your form against the fields you want to search for, and then it will retrieve a list based on the result as I described above.