Chapter 8 Creating J2EE Applications for BEA WebLogic


Using EJB 2.0 WebLogic QL Extension for EJB QL

WebLogic Server has an SQL-like language, called WebLogic QL, which is an extension of standard EJB QL. This language works with the Finder expressions and is used to query EJB objects from the RDBMS. The query is defined in the weblogic-cmp-rdbms-jar.xml deployment descriptor using the weblogic-ql element.

There must be a query element in the ejb-jar.file that corresponds to the weblogic ql tag in the weblogic-cmp-rdbms-jar.xml file. However, the weblogic-cmp-rdbms-jar.xml query element overrides the ejb-jar.xml query element.

ORDERBY

The WebLogic QL extension, ORDERBY, is a keyword that works with the Finder method to allow you to specify which CMP field you want to use for the ordering of your selections.

The following example shows the use of the WebLogic QL extension, 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.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.