Index

DKCQExpr

Purpose:

DKCQExpr is a compound query expression used to specify a compound query, that is a query containing a combination of a parametric, text, and image query, joined together using logical operators "AND", "OR", or "NOT". It is also an alternate form of a compound (or federated) query string.

The relationships of DKQTerm, DKQExpr, and DKCQExpr can be summarized using the following EBNF notation:

  DKCQExpr  =   DKQExpr   {logicalOperator  DKQExpr}
              |            negationOperator DKQExpr.
  DKQExpr   =   DKQTerm optionList parameterList.
  DKQTerm   =   DKQFactor {logicalOperator  DKQFactor}        
              |            negationOperator DKQFactor.
  DKQFactor =   AttributeName relationalOperator AttributeValue
              | AttributeName "BETWEEN" AttributeValue AttributeValue
              | AttributeName "IN"      AttributeValue {AttributeValue}
              | TextQueryString
              | TextQueryString IntegerOptions.
  logicalOperator  = "AND" | "OR".
  negationOperator = "NOT".
  relationalOperator = "=" | ">" | "<" | ">=" | "<=" | "!=".
  AttributeName   = Identifier.
  AttributeValue  = .
  TextQueryString = .
  IntegerOptions  = .
  optionList      = .
  parameterList   = .

Class summary:

class DKCQExpr
{
  public:
   DKCQExpr();
   DKCQExpr(DKQExpr* queryExpr);
   virtual ~DKCQExpr();
 
   virtual short getQLType();
   virtual void setQLType(short qlType);
   virtual DKString getDatastoreType();
   virtual void setDatastoreType(const char* dsType);
   virtual DKString getDatastoreName();
   virtual void setDatastoreName(const char* dsName);
   virtual DKString* getMappingNames(long& arraySize);
   virtual int* getMappingTypes(long& arraySize);
   virtual DKString* getEntityNames(long& arraySize);
   virtual DKBoolean isTranslation();
   virtual DKQExpr* getQueryExpr();
   virtual void setQueryExpr(DKQExpr* queryExpr);
};

Members:

Constructors and destructor
The first constructor is the default constructor without a parameter. The second constructor has a query expression.
DKCQExpr();
   DKCQExpr(DKQExpr* queryExpr);
   virtual ~DKCQExpr();
 

Member functions

getQLType
Gets the query language type, which could be a parametric, text, image query, combined query.
virtual short getQLType();

setQLType
Sets the query language type.
virtual void setQLType(short qlType);

getDatastoreType
Gets the target datastore type for executing this query.
virtual DKString getDatastoreType();

setDatastoreType
Sets the target datastore type for executing this query.
virtual void setDatastoreType(const char* dsType);

getDatastoreName
Gets the target datastore name for executing this query.
virtual DKString getDatastoreName();

setDatastoreName
Sets the target datastore name for executing this query.
virtual void setDatastoreName(const char* dsName);

getMappingNames
Gets the optional schema mapping names for executing this query. The default value is null, which means mapping is not required.
virtual DKString* getMappingNames(long& arraySize);

getMappingTypes
Gets the optional schema mapping types for executing this query. The default value is 0, which means mapping is not required. Valid types are:
  • DK_FED_MAPPED_ENTITY
  • DK_FED_MAPPED_TEXT_ENTITY

virtual int* getMappingTypes(long& arraySize);

getEntityNames
Gets the mapped entity names in this query expression.
virtual DKString* getEntityNames(long& arraySize);

isTranslation
Check if this query requires schema translation using schema mapping.
virtual DKBoolean isTranslation();

getQueryExpr
Gets the query expression. It could be a tree of DKQExpr query expressions connected by logical operator AND or OR.
virtual DKQExpr* getQueryExpr();

setQueryExpr
Sets the query expression tree.

Parameters
queryExpr -- A query expression tree.

virtual void setQueryExpr(DKQExpr* queryExpr);

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.