This content has been marked as final.
Show 4 replies
-
1. Re: Entity-query of Contact List sample does not run against
fhh Aug 25, 2007 11:30 AM (in response to kumlali)String concatenation in SQL is either done by the concat() function (ANSI) or by using two pipes (|| - supported by almost all rdbms).
Regards
Felix -
2. Re: Entity-query of Contact List sample does not run against
kumlali Aug 25, 2007 4:15 PM (in response to kumlali)Thanks Felix. I was actually looking for EJB QL expression, not SQL function. Anyway, your reply helped me find following comment from Hibernate Reference document[1]:
string concatenation ...||... or concat(...,...) (use concat() for portable EJB-QL queries)
After I changed the query as follows, it worked with both Oracle and HSQL:<fwk:entity-query name="contacts" max-results="5"> <fwk:ejbql>from Contact</fwk:ejbql> <fwk:order>lastName</fwk:order> <fwk:restrictions> <value>lower(firstName) like lower( concat(#{exampleContact.firstName}, '%' ))</value> <value>lower(lastName) like lower( concat(#{exampleContact.lastName}, '%') )</value> </fwk:restrictions> </fwk:entity-query>
Sample's code in CVS should be changed to make the application more portable, I believe. If Seam developers think the same way, I can create a Jira issue.
Regards,
Ali Sadik Kumlali
[1] http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/queryhql.html -
3. Re: Entity-query of Contact List sample does not run against
christian.bauer Aug 25, 2007 4:20 PM (in response to kumlali)Please open a JIRA issue.
-
4. Re: Entity-query of Contact List sample does not run against
kumlali Aug 25, 2007 6:31 PM (in response to kumlali)Done: http://jira.jboss.org/jira/browse/JBSEAM-1864
Regards,
Ali Sadik Kumlali