[jboss-user] [JBoss Seam] - Re: Entity-query of Contact List sample does not run against

kumlali do-not-reply at jboss.com
Sat Aug 25 16:15:05 EDT 2007

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]:

anonymous wrote : 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.


Ali Sadik Kumlali

[1] http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/queryhql.html

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078063#4078063

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078063

More information about the jboss-user mailing list