O'Reilly logo

Enterprise JavaBeans, Third Edition by Richard Monson-Haefel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Problems with EJB QL

EJB QL is a powerful new tool that promises to improve performance, flexibility, and portability of entity beans in container-managed persistence, but it has some design flaws and omissions.

The OBJECT( ) Operator

The use of the OBJECT() operator is unnecessary and cumbersome and provides little or no value to the bean developer. It’s trivial for EJB vendors to determine when an abstract schema type is the return value, so the OBJECT() operator provides little real value during query translation. In addition, the OBJECT() operator is applied haphazardly. It’s required when the return type is an abstract schema identifier, but not when a path expression of the SELECT clause ends in a CMR field. Both return an EJB object reference, so the use of OBJECT() in one scenario and not the other is illogical and confusing.

When questioned about this, Sun replied that several vendors had requested the use of the OBJECT() operator because it will be included in the next major release of the SQL programming language. EJB QL was designed to be similar to SQL because SQL is the query language that is most familiar to developers, but this doesn’t mean it should include functions and operations that have no real meaning in Enterprise JavaBeans.

The Missing ORDER BY Clause

Soon after you begin using EJB QL, you will probably realize that it’s missing a major component, the ORDER BY clause. Requesting ordered lists is extremely important in any query language, and most major query ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required