OQL.NET is a
strong-typed database object query language. The difference between OQL.NET and
SQL or other OQL lies in that OQL.NET is based on native.NET language (e.g. C# and VB.NET) instead
of on strings.
OQL.NET is compatible with SQL-92 standard. It supports
all the major elements of SQL DML, including select, insert, update and delete
statements, and select, from, join, on, where, group by, having, order by and
case clauses.
OQL.NET is well designed. Without installing a
plug-in, you can get precise and proper context tip
(IntelliSence, Code-Insight)
while writing OQL through IDE. OQL.NET can guide user to write out correct and
compatible database query statements step by step.
OQL.NET is a
complete object-oriented and strong-typed database query language. The query
statements you write will be compiled
together with your program. Thus, during compiling, OQL.NET can help you find
the errors in the query statements, instead of picking up them with great
difficulty at the runtime. If the schema of a database is changed, you can
regenerate the query classes with Macrobject CodeAuto (a code generator) etc.,
and as you compile the program again, the compile-time errors will tell you
which OQL statements need to be altered.
OQL.NET
supports many kinds of databases. While switching between databases, it is not
necessary to change the source code or recompile it.
OQL.NET can help reduce over 80%
of the working time spent in writing query statements, and 95% of the time in
debugging them. It costs no performance loss, nevertheless, it improves the
reliability of the system (a program without any wrong query statements).
With OQL.NET, you can divide a database schema
into several sub-schemas, which will help you to assign tasks and applications.
The mapping mechanism offered by OQL.NET also allows developers to
rename the data objects and their properties with much more simple and
understandable names, which
makes the codes more legible.
OQL.NET is based on the style of cascading statements in native language. It is so legible that it is as good as the original SQL statement. OQL.NET supports dividing long query statements into small parts and extracting the common parts, which is similar to the refactoring function (e.g. Extracting subfunction). Thereby it is much easier to read and maintain.
OQL.NET also supports object expressions, which can significantly simplify the work of writing query statements.
The SQL statements generated by OQL.NET are precise and well formatted. All SQL statements in this tutorial are generated through OQL.NET at the runtime, without any manual work.
More information will be given in the following chapters. A simple sample is as below:
|
SelectQuery getCustomerFromOrder = OQL .Select(NW.Order.CustomerID) .From(NW.Order) .Where(NW.Order.ShipCity == " SelectQuery qryCustomer
= OQL .SelectFrom(NW.Customer) .Where(NW.Customer.CustomerID.In(getCustomerFromOrder)); |
|
Equal to the following object expressions |
|
SelectQuery qryCustomer
= OQL .SelectWhere(NW.Customer == (NW.Order.ShipCity == " |
Related Topics