[
https://jira.jboss.org/jira/browse/JBSEAM-1065?page=com.atlassian.jira.pl...
]
Terry commented on JBSEAM-1065:
-------------------------------
This issues has become a painful and pretty much a show stopper for me. please please
enhance EntityQuery to support multiple value bindings on restriction.
My scenario requires to build restrictions based on option user selects on the search
page. Im in a situation, that if I do away with restrictions and use overridden getEjbql()
method, then my query runs multiple times.
But if I use restrictions then I have multiple binding error.
All this can be resolved if this JIRA is resolved.
I have provided some of my code below and attached screenshot of information.
I have base EJBQL based on 5 tables:
-----------------------------------
BASE_EJBQL = "select new " + CourseSysCourseListStore.class.getName() +
"(c.id, c.code, c.shortDescription, " +
"c.longDescription, c.descriptionMajorAreasOfStudy, c.keywords, " +
"c.mosFullTime, c.mosPartTime, c.mosExternal, " +
"o.id, o.shortName, oc.id, oc.shortDescription, " +
"aos.id, aos.deetCode, aos.description, courseStatus.id) " +
"from " +
"CourseSysCourse c " +
"join c.courseSysCourseOrganisationCampus oc " +
"join oc.organisation o " +
"join c.areaOfStudy aos " +
"join c.courseStatus courseStatus";
***Then I have about 8 simple restrictions, like this which work fine of course:
restrictions.add("lower(o.id) like
#{courseSysCourseList.selectedOrgIdConverted}");
...
***But I also have several sets of restrictions like below, which need to be created and
added based on search option selected by user on search ceritera page. These create
problem:
restrictions.add("(" +
"lower(c.shortDescription) like
concat('%',#{courseSysCourseList.freeTextSearchConverted},'%') or "
+
"lower(c.longDescription) like
concat('%',#{courseSysCourseList.freeTextSearchConverted},'%') or "
+
"lower(c.descriptionMajorAreasOfStudy) like
concat('%',#{courseSysCourseList.freeTextSearchConverted},'%') or "
+
"lower(c.keywords) like
concat('%',#{courseSysCourseList.freeTextSearchConverted},'%')" +
")");
Entity Query should support multiple value bindings on restrictions.
--------------------------------------------------------------------
Key: JBSEAM-1065
URL:
https://jira.jboss.org/jira/browse/JBSEAM-1065
Project: Seam
Issue Type: Feature Request
Components: Framework
Affects Versions: 1.2.0.GA
Reporter: sal something
Priority: Minor
Fix For: The future
Attachments: patch.txt
Entity Query should support multiple value bindings on restrictions.
The use case would be the 'between' statement, as of now Entity Query will throw
an exception using a 'between' statement:
Caused by: java.lang.IllegalArgumentException: there should be exactly one value binding
in a restriction: applicationDeadline between #{vacancyBrowseSearch.appDeadlineStartDate}
and #{vacancyBrowseSearch.appDeadlineEndDate}
at org.jboss.seam.framework.Query.parseEjbql(Query.java:145)
at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:100)
at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:41)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira