-
1. Re: finder: 'order' has no effect
markfuffzich Jun 17, 2003 8:16 AM (in response to dirk.versavel)Hi,
JBoss 3.2.1 is based on EJB 2.0. ORDER BY was introduced with EJB 2.1 which is supported by JBoss 4.0.
Maybe this is your problem. -
2. Re: finder: 'order' has no effect
dirk.versavel Jun 18, 2003 3:46 AM (in response to dirk.versavel)Maybe it is, but in this same forum I have found several messages from 2001 and version 2.4 about the fact that the 'order' -tag did not work in certain jboss version for the findAll() method. So I assume it is supported in 3.2.1.
Can anyone confirm this? -
3. Re: finder: 'order' has no effect
dirk.versavel Jun 20, 2003 1:15 PM (in response to dirk.versavel)Anyone an idea whether sorting is possible in finders?
I keep searching the newsgroups but can only find people using it successfully.
Is it maybe not working on jBOSS 3.2.1 in combination with MySQL?
Any help is very welcome.
Dirk -
4. Re: finder: 'order' has no effect
jez Jun 22, 2003 7:09 PM (in response to dirk.versavel)Hi Dirk
I'm not sure if this answers your question, but Jboss 3.2 does support order by (although I haven't messed with jaws.xml) - the way I did it was to override my definition in ejb-jar.xml by inserting an identical definition in jbosscmp-jdbc.xml with one change - replace the <ejb-ql> tag with a <jboss-ql> tag.
In the jbosscmp-jdbc.xml file, you need only replicate the , <ejb-name> and part of the corresponding ejb-jar.xml entry for your EJB.
I have order by working fine with MySQL on jboss 3.2.0. If only COUNT() worked too... -
5. Re: finder: 'order' has no effect
diezgo Jul 17, 2003 2:06 PM (in response to dirk.versavel)You can modified the jbosscmp-jdbc.xml in tag add definition of ejb-jar.xml the and repleace <ejb-ql> for <jboss-ql> and modified the select sentences and ready to work.
Example :
ejb-jar.xml
....
<query-method>
<method-name>findAll</method-name>
<method-params/>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(o) FROM obj o]]>
</ejb-ql>
jbosscmp-jdbc.xml
.
.
.
<query-method>
<method-name>findAll</method-name>
<method-params/>
</query-method>
<jboss-ql>
<![CDATA[SELECT OBJECT(o) FROM obj o ORDER BY o.fld1]]>
</jboss-ql>
.
.
.