Do not use WebLogic-specific EJB Query Language constructs

This rule detects references to WebLogic Query Language. WebLogic Query Language references need to be reviewed and converted appropriately for use on WebSphere traditional and Liberty.

The <weblogic-ql> element specifies a query that contains a WebLogic-specific extension to the EJB 2.0 Query Language (EJB-QL). Standard EJB-QL language features are used in the ejb-jar.xml deployment descriptor, and WebLogic EJB-QL extensions are used in the weblogic-cmp-rdbms-jar.xml file. Ordering, aggregate functions, and subqueries are usually used in queries, but since other extensions could be used as well, always carefully inspect all <weblogic-ql> elements.

WebSphere Application Server also extends the EJB-QL language features, but instead of defining a separate QL, WebSphere Application Server provides ordering, subqueries, and aggregate functions to the EJB-QL syntax. WebSphere Application Server extends the syntax of EJB-QL to include these extensions. Therefore, you can use EJB-QL plus its extensions in the standard <ejb-ql> element in the ejb-jar.xml file.

Mapping orderby

The orderby WebLogic QL extension is a keyword that works with the Finder method to specify the order of the results that are returned from your selections. You can also order by multiple fields and specify whether to return the results in ascending or descending order.

Mapping subquery and aggregate functions

The subquery WebLogic QL extension enables a query to be embedded within the WHERE clause of the main query to return data for use in the main query as a condition to further restrict the data to be retrieved. The MAX WebLogic QL extension returns the maximum value of the specified field. This example shows a subquery and aggregate function and its mapping to WebSphere Application Server:

More information on EJB-QL is available in this topic: