Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

EJB-QL and JBOSS-QL  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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>

</query>

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

TIA
-Vili
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error do you get when you try to depploy it? Maybe the order by needs to go at the end of the query...



Here's an example from one of my JBOSS xml



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 ]
 
Vili Leonardo
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for the reply. That's it, the "order by" should be at the end of the select statement.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!