Wrox Home  
Search P2P Archive for: Go

  Return to Index  

enterprise_java_beans thread: sorting


Message #1 by "ramy m" <ramymoneiry@y...> on Mon, 5 Aug 2002 21:41:06
Hello, I got this from the bea website 
http://edocs.bea.com/wls/docs70/ejb/cmp.html which I've cut and pasted 
below.  Hope this helps.  Mitch

Using ORDERBY

The EJB WebLogic QL extension ORDERBY is a keyword that works with the 
Finder method to specify the CMP field selection sequence for your 
selections. 

Figure 5-1 WebLogic QL ORDERBY extension showing order by id.


ORDERBY
	SELECT OBJECT(A) from A for Account.Bean
		ORDERBY A.id
Note: ORDERBY defers all sorting to the DBMS. Thus, the order of the 
retrieved result depends on the particular DBMS installation on top of 
which the bean is running

Also, you can specify an ORDERBY with ascending [ASC] or descending [desc] 
order for multiple fields as follows:. 

Figure 5-2 WebLogic QL ORDERBY extension showing order by id. with ASC and 
DESC


ORDERBY <field> [ASC|DESC], <field> [ASC|DESC]
	SELECT OBJECT(A) from A for Account.Bean, OBJECT(B) from B for 
Account.Bean
		ORDERBY A.id ASC; B.salary DESC


> dear all

>   is EJB query language supports sorting , could you please give me an 
e> xample

>  thanks

  Return to Index