|
SAP BI Java SDK | |||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
IBICommandProcessor | The Relational Command Processor allows for the manipulation of a query object on a high level without exposing the underlying model. |
IBIQuery | A relational query model based on the Expressions package of the Common Warehouse Metamodel. |
IBIQueryExecute | Minimal callback between query model and connection to underlying BI Java Connector (resource adapter). |
IBIQueryExpression | Simple wrapper to provide access to the elements of the query. |
IBIQueryExpressionColumnRef | A column reference is a column with optional table reference
(see table reference ), necessary
in case of self-joins (for example), to determine the instance of the
table in the query to which this column belongs. |
IBIQueryExpressionGroupByRef | Grouping is necessary for all columns of the selection that are not aggregated, and the order of grouping is specified as a list of column references. |
IBIQueryExpressionOrderByRef | Ordering of the result set of a query can be specified by column and order direction. |
IBIQueryExpressionSelectColumnRef | A selection column reference is a column reference with optional
aggregation function (COUNT , SUM ,
MIN , MAX , AVG ) and label
(for example, in SQL COUNT(<column>) AS <label> ). |
IBIQueryExpressionTableRef | Table references are needed because relational queries can contain multiple instances of the same table (for example, with self-joins) and each instance needs to be individually (and uniquely) referenceable. |
IBIQueryRepository | Interface between the query model and the Metamodel Repository. |
The main package of the Relational Query API, which provides classes to create and execute relational queries independently of the underlying resource adapter (one of the BI Java Connectors). This package documentation contains the following sections:
The Relational Query API consists of a set of classes generated via JMI from
the Relational Query Model, which is based on the org.omg.cwm.foundation.expressions
package of the Common Warehouse Metamodel (CWM), and loosely on a subset of
the SQL
standard.
A relational query in this sense is an expression tree of a functional representation
of the corresponding SQL
-like statement. This allows for simple
code generation from the expression tree for the various relational backends
(resource adapters, or BI Java Connectors), such as SQL
for the
BI JDBC Connector and an RFC
call via JCo
for the
BI SAP Query Connector.
This package contains the main classes of the Relational Query API including the Relational Command Processor, and also collects the following supporting sub-packages:
Component | Associated SDK Package |
---|---|
Relational Command Processor SDK extensions to the CWM Expressions package |
this package |
Interfaces relevant for SAP Query |
com.sap.ip.bi.sdk.dac.relational.query.sapq |
Interfaces that help represent a WHERE condition in tree
form |
com.sap.ip.bi.sdk.dac.relational.query.tree |
The Relational Command Processor hides the complexity of the CWM Expressions package, which forms the basis of the Relational Query Model and assists in instantiating valid query instances. You can rely on the Relational Command Processor for most of your relational querying needs.
The Relational Query Model corresponds with the following subset of SQL (specified as a grammar in Backus-Naur Form):
<single-row-select> | → | <select-clause> <from-clause> [<where-clause>] [<group-by-clause>] [<order-by-clause>] [<having-clause>] |
<select-clause> | → | SELECT [<select-item>,*]<select-item> |
<select-item> | → | <single-column> | <all-columns> |
<single-column> | → | <scalar-expr> AS <column> |
<all-columns> | → | [<range-var>.]* |
<scalar-expr> | → | <column-ref> | <aggr-func-ref> |<quoted-value> | <numeric-value> |
<aggr-func-ref> | → | <count-aggr-func-ref> | <min-aggr-func-ref> | <max-aggr-func-ref> | <avg-aggr-func-ref> |
<count-aggr-func-ref> | → | COUNT(<column-ref>) |
<min-aggr-func-ref> | → | MIN(<column-ref>) |
<max-aggr-func-ref> | → | MAX(<column-ref>) |
<avg-aggr-func-ref> | → | AVG(<column-ref>) |
<column-ref> | → | [<column-quantifier>.]<column> |
<where-clause> | → | WHERE <cond-expr> |
<group-by-clause> | → | GROUP BY [<column-ref>,*]<column-ref> |
<order-by-clause> | → | ORDER BY [<order-item>,*]<order-item> |
<order-item> | → | <column>[ <order-dir>] |
<order-dir> | → | ASCENDING | DESCENDING |
<having-clause> | → | HAVING <cond-expr> |
<from-clause> | → | FROM [<table-ref>,*]<table-ref> |
<table-ref> | → | <table>[ <range-var>] |
<catalog> | → | <catalog> |
<schema> | → | [<catalog>.]<schema> |
<table> | → | [<schema>.]<table> |
<range-var> | → | <rangevar> |
<column-quantifier> | → | <table>|<range-var> |
<column> | → | <column> |
<cond-expr> | → | [<cond-term> OR ]<cond-term> |
<cond-term> | → | [<cond-term> AND ]<cond-factor> |
<cond-factor> | → | [NOT ]<cond-test> |
<cond-test> | → | <cond-primary>[ IS NULL] |
<cond-primary> | → | <simple-cond> | ( <cond-expr> ) |
<simple-cond> | → | <comparison-cond> | <between-cond> | <like-cond> | <in-cond> | <test-for-null-cond> |
<comparison-cond> | → | <row-constructor> <comparison-operator> <row-constructor> |
<comparison-operator> | → | <equals-operator> | <less-than-operator> | <greater-than-operator> | <less-equals-operator> | <greater-equals-operator> |
<equals-operator> | → | = |
<less-than-operator> | → | < |
<greater-than-operator> | → | > |
<less-equals-operator> | → | <= |
<greater-equals-operator> | → | >= |
<between-cond> | → | <row-constructor> BETWEEN <row-constructor> AND <row-constructor> |
<like-cond> | → | <row-constructor> LIKE <row-constructor> |
<escape> | → | ESCAPE <escape> |
<in-cond> | → | <in-cond-list> | <in-cond-sub-select> |
<in-cond-list> | → | <row-constructor> IN ([<row-constructor>,*]<row-constructor>) |
<in-cond-sub-select> | → | <row-constructor> IN <single-row-select> |
<test-for-null-cond> | → | <row-constructor> IS NULL |
<row-constructor> | → | <scalar-expr> |
<quoted-value> | → | <quoted> |
<numeric-value> | → | <numeric> |
Notes:
<non-terminal-symbol>
.
<terminal-symbol>
.
KEYWORD
.
|
" separates alternative grammar productions.
[
…]
" encloses optional grammar productions.
*
" specifies that the preceding grammar production
can occur an arbitrary number of times.
Terminal Symbol | Corresponding Java Type |
---|---|
<catalog> |
String (valid catalog name, if supported) |
<schema> |
String (valid schema name, if supported) |
<table> |
String (valid table name) |
<rangevar> |
String (valid range-var string) |
<column> |
String (valid column name) |
<escape> |
char |
<quoted> |
String surrounded by single quotes |
<numeric> |
int ,double |
WHERE
conditions are tree-like expressions (Backus-Naur
Form, referenced above, implies binary logical operators and enclosing
parentheses), the Relational Command Processor implies a sequential model
of query generation and manipulation, hence the WHERE
condition
is formulated using a logically equivalent postfix representation (a stack-based
approach). In other words, the predicates are pushed onto an implied WHERE
stack followed by the logical operators (see the Relational
Command Processor).
|
SAP BI Java SDK | |||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |