I have a working EJB-QL declared in the ejb-jar.xml like the following:
<query> <query-method> <method-name>findByClient</method-name> <method-params> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql> SELECT OBJECT(d) FROM PartSchema d WHERE d.partClient = ?1 </ejb-ql> </query>
Now, I want to get the search result sorted. I think I can achieve that using JBOSS-QL.
I have been trying declaring the jboss-ql in jbosscmp-jdbc.xml like this
<query> <query-method> <method-name>findByClient</method-name> <method-params> <method-param>java.lang.String</method-param> </method-params> </query-method> <jboss-ql><![CDATA[SELECT OBJECT(d) FROM PartSchema d ORDER BY d.partID WHERE d.partClient = ?1 DESC]]> </jboss-ql>
But, it won't deploy.
Does anyone have any example how to use Jboss-ql ? Any tips is greatly appreciated here. Oh btw, I use jboss-3.2.5
I know this works because the data is then used by a graphics routine...if the ORDER BY wasn't working it would be joining dots randomly instead of forming lines from them...which it was doing for a while before I realised my colleague had left the ORDER BY out and just used EJB-QL :roll:
If you can't get it to work for you you could sort the results in Java, but I believe I read that is a slower way of doing it, and will also involve you writing extra code. [ August 23, 2004: Message edited by: Ben Wood ]
SCJP 1.4, www.gsi3d.org.uk
posted 14 years ago
Hi Thanks for the reply. That's it, the "order by" should be at the end of the select statement.