The ODMG Object Query Language (OQL) is a standard query language for object oriented APIs. It is a declarative query language based on the syntax of the Structured Query Language (SQL), the query language used with relational databases. The basic querying construct is the same as that used in SQL, i.e., a SELECT...FROM...WHERE statement.
OQL was designed to be object-oriented. Queries are specified using objects and their attributes (data-members). Similarly, queries return sets of objects. The complex relationships in an object model can be easily navigated, using the same class-member paradigm, used by object-oriented programming languages. This can often lead to increased performance over SQL, where resource-consuming join processes are necessary to capture relationships. Another big advantage is, that table names and column names are not necessary in the query strings, because queries are formulated using class names and attribute names and no mapping knowledge is necessary in the application.
OQL may be used as an embedded language or as a standalone query language. Both of these are supported by OpenAccess. As an embedded language, OQL queries can be used directly in your application programs. Programs can embed OQL queries, and receive results in the native data types of the programming language being used. OQL statements are simply text strings, which means that the standard string representation of your programming language is used to express the query.
The following sections discuss the OQL language. For detailed information about performing queries within OpenAccess, refer to the OpenAccess .NET API Reference included with your OpenAccess installation.
||The ODMG OQL Standard: You may also want to read the standard definition of the Object Query Language, published by the Object Data Management Group. Visit the ODMG web site at http://www.odmg.org for more information. |