EJB QL
Encyclopedia
EJB QL or EJB-QL is a portable database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

 query language
Query language
Query languages are computer languages used to make queries into databases and information systems.Broadly, query languages can be classified according to whether they are database query languages or information retrieval query languages...

 for Enterprise Java Beans. It was used in Java EE applications. Compared to SQL, however, it is less complex but less powerful as well.

History

The language has been inspired, especially EJB3-QL, by the native Hibernate Query Language HQL.

In EJB3 It has been mostly replaced by the Java Persistence Query Language
Java Persistence Query Language
The Java Persistence Query Language is a platform-independent object-oriented query language defined as part of the Java Persistence API specification.JPQL is used to make queries against entities stored in a relational database...

.

Differences

EJB QL is a database query language similar to SQL. The used queries are somewhat different from relational SQL, as it uses a so-called "abstract schema" of the enterprise beans instead of the relational model. In other words, EJB QL queries do not use tables and their components, but enterprise beans, their persistent state, and their relationships. The result of an SQL query is a set of rows with a fixed number of columns. The result of an EJB QL query is either a single object, a collection of entity objects of a given type, or a collection of values retrieved from CMP
CMP
- Medicine :* Cardiomyopathy, a heart muscle disease* Chondromalacia Patellae, a degenerative condition of the knee cap * Chronic myofascial pain, also known as Myofascial pain syndrome, a condition associated with hypersensitive muscular trigger points...

fields. One has to understand the data model of enterprise beans in order to write effective queries.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK