查询语言

iTop使用对象查询语言(简称:OQL)去定义检索持久化对象的查询。

OQL查询在iTop中定义或配置对象集合的很多地方被使用(审计规则,通知等)。

OQL语言的目标是隐藏数据模型中实际SQL模式的复杂性,利用OQL定义提供了一个安全(查询时进行访问权限控制),强大的(OQL可以表达复杂的条件),高效的(OQL查询解析成一个SQL查询),对象清晰的(尊重类继承)并且简单的语法。

OQL语句类似于SQL语句,OQL语法是基于SQL语言的子集。

到目前为止,只有SELECT语句已经实现。

这样的语句只能返回两种类型的数据集:

  • 要么是指定类的对象列表。

  • 或者是对象和关联对象的列表(每行有对个类对象)。

OQL语言区分大小写,所有关键字都是大写的。

本书内容

  • 修订历史

    原文:https://www.itophub.io/wiki/page?id=2_6_0%3Aoql%3Astart


    Object Query Language Reference

    The Object Query Language (in short: OQL) is the language used by iTop for defining queries that retrieve persisted objects.

    OQL queries are used in many places in iTop (audit rules, notifications, etc.) to define or configure sets of objects.

    The goal of the OQL language is to hide the complexity of the actual SQL schema of the data model while leveraging its definition for providing a secure (access rights are enforced by the queries), powerful (complex conditions can be expressed in OQL), efficient (one OQL query is translated into exactly one SQL query), object-aware (class inheritance is respected) and simple syntax.

    The OQL syntax is similar to the syntax of SQL, the OQL grammar is basically a subset of the SQL grammar.

    As of now, only SELECT statements have been implemented.

    Such statements do return two kinds of data set:

    Either a list of objects of the selected class.

    Or a list of objects and related objects (several classes of objects per row)

    Content of this book

    Example: the bookstore

    OQL Statements Syntax

    OQL Grammar

    Known Issues and Limitations

    Examples

    Revisions history

    The OQL language is case sensitive and all keywords are to be written in UPPERCASE

标签:
由 superadmin 在 2020/08/25, 16:21 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司