Skip to Content

h2.

Introduction :-

EJB QL, as many know is the acronym for Enterprise Java Beans Querying Language.Many of us know how to use them.Here I am just trying to explain the fundamental components of it.

Sun Microsystems’s EJB 1.1 specification doesn’t offer a standard way to define queries for finder methods in Entity Beans with CMP. To address this EJB QL was introduced with EJB 2.0.

In EJB1.1 developers have to redefine queries for the finder methods whenever an application is moved from one vendor’s application server to another’s. This makes applications built using CMP less portable and also not scaleable.

Moreover, EJB 1.1 do not address how to define a query for an Entity bean with CMP to navigate with other Entity beans in relationships, or associations. Also nothing was specified how to have queries to access from one entity bean to its dependent classes and the member variables of those dependent classes.

EJB 2.0 deals with these shortcomings by defining the EJB Query Language. It is based on the SQL-92 specification for defining various finder() and select() methods of Entity beans with CMP. The EJB QL query string consists of three clauses: SELECT, FROM, and WHERE. Among other things, EJB QL offers a standard way to define relationships between entity beans and dependent classes by introducing abstract schema types and relationships in the deployment descriptor file.

h4. Components of EJB QL :-

The following syntax is the basic format of the EJB QL query:

EJB QL ::=  select_clause  from_clause  (table name)

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply