WL#4838: QFPD: metamodel and interface for database objects

Affects: Server-7.x   —   Status: Assigned   —   Priority: Medium

AQT interface for database objects

    The AQT API is classified into two following broad categories: 
1. AQT for database persistent objects such as table, columns, indexes and so on.
2. AQT for query representation.

   This worklog is for the first category: database objects.

   This API provides stable interface for storage engines to obtain database
metadata information.
The AQT API should be provided for the following database objects :

   - Table 
   - Column 
   - Index
   - Views
   - Triggers
   - Foreign Key

   The users of AQT will see mostly abstract classes. However the implementation
of AQT will use concrete classes to create the objects. It often requires to 
expose the collection of items for read-only purposes without exposing internal 
details. For this, the specific type of Iterator classes would be used which 
uses the internal server datastructures as backing store and provides a read-
only interface. The implementation of Iterator interface is tracked by WL#4848

    This part of API mainly provides restricted set of data dictionary service
for the purpose of use with storage engines.

High Level Plan

  The following tasks will be handled in this order as milestones :

M1. Define high level AQT API for the objects.
    Status:  (100%)
M2. Create a prototype which prints some information in Table, Column, Indexes.
    This uses partial draft implementation of API. This is done as proof of 
    concept for the implementation approach. 
    Effort:  2 weeks
    Estimated Completion Time: 20 May 2009

M3. Refine the API for stability under concurrency 
    [ What happens to the user of AQT when the underlying table is dropped. ]
    There may be limitations in initial implementation.
    Effort : 1 week
    Estimated Completion Time: 27 May 2009

M5. Implement AQT API for Table, column, Indexes
    Effort :  2 weeks
    Estimated Completion Time: 09 Jun 2009
    Note: This task is WL#4900

M6. Implement AQT API for Views, Triggers, Foreign Keys
    Effort : 10d
    Estimated Completion Time: 23 Jun 2009

M7. Testing 
    Effort : 3 weeks
    Estimated Completion Time: 15 July 2009

M8. Document AQT source for use with doxygen [ To be done in parallel with M7]
    Effort : 3 weeks
    Estimated Completion Time: 22 July 2009

                MySQL Database Model Objects Design

Last Updated: 6 Jun 2009

This document describes the design for database model objects WL#4838.

1.0.  Background:

   To enable query fragment pushdown to storage engines, 
WL#4533 suggests to create a stable API interface inspired by a model 
driven architecture. WL#4838 focuses on creating model for database 
objects such as Tables, Columns and Indexes. WL#4841 focuses on modeling 
most of the complex aspects of queries.

   The chosen approach for modeling is broadly inspired by
the Eclipse's SQL Metamodel. 
    See http://www.eclipse.org/datatools/project_modelbase/
for pointers to UML documentation for the Eclipse's model provided by
Data Tools Platform project. This is the same model which is to be
adopted by OMG as part of it's upcoming standard IMM (Information 
Management Metamodel) which is the successor of existing 
Common Warehouse Metamodel (CWM).

  The approach for the initial design will focus on meeting essential 
requirements rather than trying to be generic and comprehensive. 
Also, it is worth noting that while our model is inspired by Eclipse's 
SQL model, the primary objectives are different.
The Eclipse's Model enables a framework of tools to easily analyze and 
transform data in a database agnostic manner. The primary aim of 
MySQL model is to be able to push the query fragment using an interface 
which is stable, easy to use and extensible. 

Nevertheless, much of the Eclipse's SQL model can be leveraged 
for our purpose while making simplifications whenever possible.

2.0  Design

2.0.0. Overview

   The primary classes involved in database model objects are
Table, Column and Index [and also Trigger, Table_constraint (TBD), 
and also other classes derived from these].

    The database model objects does not serve as a generic database
dictionary service. It just provides all necessary information about all
related database objects given a query for the purpose of query pushdown. 

  The broad level of inheritance hierarchies are given below with highlevel
details. The lowlevel design will follow later.  Table Class

    Table {name, columns(), database(), type()} 
      |                               | 
   Base_table                     View_table
  |             |
Persistent     TempTable


Following text is taken from SQL Standard 5WD-02-Foundation-2003-09
Section 4.14.2 Types of Tables : 

-----------------------Begin quote ---------------------------------------

A table is either a base table, a derived table, or a transient table. 
A base table is either a persistent base table, a global temporary table, 
a created local temporary table, or a declared local temporary table.

A persistent base table is a named table defined by a <table definition> 
that does not specify TEMPORARY.

A derived table is a table derived directly or indirectly from one or 
more other tables by the evaluation of a <query expression> whose result 
has an element type that is a row type. The values of a derived table are
derived from the values of the underlying tables when the <query expression>
is evaluated.

A viewed table is a named derived table defined by a <view definition>. 
A viewed table is sometimes called a view.

A transient table is a named table that may come into existence implicitly 
during the evaluation of a <query expression> or the execution of a trigger.
A transient table is identified by a <query name> if it arises during
the evaluation of a <query expression>, or by a <transition table name> 
if it arises during the execution of a trigger. Such tables exist only 
for the duration of the executing SQL-statement containing the 
<query expression> or for the duration of the executing trigger.

-----------------------End quote ---------------------------------------

  Note that "Transient Table" is not modeled here as it is not of
interest for query push down. 

   Strictly speaking, view_table could have been modeled as a special 
type of Derived_table which is a named derived table. However, 
for the sake of simplicity, it is proposed to have single "View_table"
in this model which could essentially represent all types of derived
tables. [ Revisit this and verify. ]

   The partition information is modeled as an attribute of Base_table 
as it could be viewed as something related to the storage behaviour. 
Note that the partition table is not dealt with Eclipse SQL model as it
is viewed as database vendor specific feature.  Column Class

     Table contains columns. Column is a typed element and hence inherits
from TypedElement base class. 

      Table <>-1-----contains-----1..* Column
      Column--------is_a----------> Typed_element 

      Typed_element specifies the data type information. The type 
information includes associated SQL type, length, precision, 
charset and collation information as applicable. Index Class

     Table contains indexes. 
     An Index is associated with one or more columns.
     An Index may exist to implement a constraint (as in the case of
unique/foreign key constraint) or may just be a regular non-unique index.

     Table <>-1-----contains----0..*-  Index Table_constraint Class

     SQL Standard 5WD-02-Foundation-2003-09 4.17 Integrity Constraints 
provides a detailed description about the constraints.

    A constraint could be one of following :
      (a) Table Constraint   (Involves single table)
      (b) Domain Constraint  (Restricted Datatype. E.g Integer>10 )
      (c) Assertion (Involves multiple tables)

   MySQL supports only (a) Table constraints hence we model only that.

   The table constraint could be one of the following :
      (a) Unique Constraint [ As defined by "unique" or "primary key" ] 
      (b) Referential Constraint [ Foreign Key ]
      (c) Check Constraint 

   The check constraints are currently parsed and ignored by MySQL.
Hence we do not model them now.

    We model the unique and referential constraints only.
In addition, the unique constraint could be a primary key constraint.

Logically, these constraints have following hierarchy :

          |                     |                            |
          |                     |                            |
   Unique-Constraint    Referential-Constraint           Check-constraint
          ^                (Foreign Key)

3.0. Implementation

3.0.0. Overview

   This model is implemented as a view over an existing internal 
implementation. This is essentially an adaptor over internal data
structure which exposes only necessary information. 

   The implementation also makes use of "Iterator" mechanism while 
dealing with collection of objects. This approach avoids making
unnecessary copies of collection of objects.

   The use of this model is limited to explore the database objects
used in the query.

For example, consider the following query :

      Select  * from t1 ;

   The query pushdown logic may present this query to storage engine
through some class in a structured form through some pushdown interface.
[ The exact details of this interface is out of scope for this document. ]
In that context, the storage engine could only explore the details about
the table t1 and it's indexes and so on. The interface can not be used 
to explore all details about an unrelated table in that context.

3.0.1. Name spaces

  It is proposed to use following 3 name spaces for the models used :

  model_base   :   Common classes used in the model
  db_model     :   All database model objects such as Table, Column, Index
  query_model  :   All query related model objects 

  The db_model implementation depends on model_base implementation.
  The query_model implementation depends on db_model implementation.

  It is worth comparing these with Eclipse SQL Model Objects given
in Appendix A. 

   Eclipse model provides a complex set of package hierarchies and 
class hierarchies. 

   This implementation adopts same class name (except for change for naming
convention in C++) in many cases and makes simplifications whenever

3.0.2. Implementation Scope

The following aspects are not modeled for now and are considered to be
not essential for the purpose of query fragment pushdown :

   (a) Features not supported by MySQL: For example, User defined datatype.

   (b) The table privileges related aspects are not modeled for now.

   (c) Triggers are excluded.

   /* Include other features not modeled here. */

3.0.3.  Meta_object Class Implementation

We briefly discuss the Meta_object common class before discussing others.

All SQL objects are derived from Meta_object class. This encapsulates
common information and behaviour across all objects. 

  It is proposed to have the following information in Meta_object class :
     Name,   Alias;    // See below for the Note.
     Meta_type;        // TBD
     Any Other?        // TBD e.g. Memory Allocation Strategy ?

However it is noted that some auxilary objects such as Index_member
(which is part of index) may not have a formal name associated with it.
Many SQL objects do not have formal "alias" name associated as well.
The interface could be made to return invalid (null) value when this 
is not applicable. However this should not create confusion to the
users of the interface who expects the name and alias to have something
in some contexts when this is not applicable. 
Also, this is probably a good idea to keep the information here at the
minimum to avoid name clash problems while using multiple inheritance.

   The equivalent thing in Eclipse Model is SQL_object Java interface 
(not class) which seems to support getName() in the common super class 
but not alias. 

The exact attributes of Meta_object are TBD. [ Meta-Object.Issue-1 ]

For the sake of brevity we exclude the references to Meta_object in
class hierarchy here after in this document.

3.0.4. Connection Class

   Much of API implementation requires connection context information.
Hence it is proposed to introduce this common Connection abstract class 
defined as follows :

  class Connection : public  Meta_object {
    virtual void  *mem_alloc(size_t size)=0; /*< Session pool malloc */
    virtual void  mem_free(void *) = 0;      /*< Free allocated memory */

For most part API user would see pointer to abstract Connection class.
The Connection_impl class will be declared in a separate model_base_impl.h
header file as follows :
  class  Connection_impl : public Connection {


       Connection_impl(THD  *t)
           thd = t;
           // Initialize thread/connection specific hash tables here.

          // Free connection specific Hash table resources
          THD  *thd;
          // Include thread specific hash tables here.

Essentially, it contains THD pointer and any other desired connection
context information. The constructors of most of the implementation 
concrete classes take the pointer to Connection_impl as parameter.

3.0.4. db_model interface header file db_obj.h 
   The db_obj.h header file provides the main interface for database
model objects. There is a separate another header file db_obj_impl.h
which contains corresponding concrete implementation classes.

The db_obj.h header file is provided below:

    @file  db_obj.h
    @mainpage   Abstract interface for database model objects.

    DB objects model API provides abstract interface for database 
objects such as Table, Column, Index and Database. 

Note that the goal of abstract model API is to provide stable interface 
for use by storage engines. Currently exposing internal structures 
such as THD to storage engine results in volatile interfaces often 
breaking the storage engines when the internal server implementation 


#ifndef  MODEL_DB_OBJ_H
#define  MODEL_DB_OBJ_H

#include  "model_common.h"
#include  "db_iter.h"

// Imported class declarations.

namespace  query_model {
    class Query_expression;

using namespace model_common;

namespace db_model  {

/* Exported classes */

class  Database;
class  Table;
class  Base_table;
class  View_table;
class  Column;
class  Index;
class  Fkey;
class  Trigger;

class  Table_constraint;
class  Ukey;
class  Index_member;

typedef Ukey  Pkey;

/* List of class definitions */

   @class  Database
   @brief  Abstract database class
class  Database : public ::model_common::Meta_object {

  /* Get the list of tables */
  virtual  ::model_common::Iterator_string *get_table_names()=0; 
  /* Get the list of views */
  virtual  ::model_common::Iterator_string *get_view_names()=0;   


   @class  table
   @brief  Abstract Table base class
class  Table : public ::model_common::Meta_object {

public :

  virtual Database  *get_database()=0;        /*< Get database */
  virtual bool  get_alias(::String *str)=0;   /*< Get alias name */
  virtual Iterator_column  *get_columns()=0;  /*< Get column list */

     Table types: 

        UNKNOWN_TABLE     : Invalid unknown table type.

        PERSISTENT_TABLE  : Persistent, user defined, regular tables.
                   Hierarchy: Table=>Base_table=>Persistent_table

        TEMP_TABLE        : Non-persistent, visible only to session.
                            (could be user created temp table or server 
                            generated temp table)
                   Hierarchy: Table=>Base_table=>Temp_table

        VIEW_TABLE        : Represents view or derived table.
                   Hierarchy: Table=>View_table

  enum Table_type {
          UNKNOWN_TABLE,                    /*< Unknown Table Type */
          PERSISTENT_TABLE,                 /*< Persistent Table */
          TEMP_TABLE,                       /*< Temp Table */
          VIEW_TABLE,                       /*< View Table or View */
  } ;

  virtual Table_type  get_table_type()=0;    /*< Get table type */
  virtual bool  get_engine_name(::String *str)=0; /*< Get storage engine name*/
  virtual bool  get_charset(::String *str)=0;/*< Get charset name */
  virtual bool  get_collation(::String *str)=0;/*< Get collation name */

  enum Row_format {

  virtual Row_format get_row_format()=0;     /*< Get row format. */


   @class  Column
   @brief  Abstract column base class.
           This represents the column of an active table in database.
class  Column : public ::model_common::Meta_object {


  virtual  Table *get_table()=0;               /*< Get associated table */
  virtual  bool  is_nullable()=0;              /*< Is column nullable? */
  /* Get default value for this column in String form */
  virtual bool  get_default_value_str(::String *def)=0;  
  /* Get column number. First column starts from 1. */
  virtual int  get_column_number()=0;    

  virtual  bool  is_unique()=0;              /*< Is unique column? */
  virtual  bool  is_pkey()=0;                /*< Is primarykey column? */
  virtual  bool  is_sequence()=0;            /*< Is auto increment col?*/

  /* Get SQL data type.  */
  virtual  ::model_common::Datatype  *get_datatype()=0; 

  /* Get Charset name. Applies to only char based types */
  virtual bool  get_charset(::String *str)=0;
  /* Get collation name. Applies to only char based types */
  virtual bool  get_collation(::String *str)=0;


   @class Base_table 
   @brief The Base_table represents actual table in the database.
          This can be a persistent regular table or a temporary table. 
          Note that a view table is not a base table.
class Base_table : public Table {

public :

   /* Is this temp table? The temp table is visible only in session. */
   virtual bool  is_temp_table() = 0;
   virtual Iterator_index   *get_indexes()=0;   /*< Get index list */
   virtual Iterator_trigger *get_triggers()=0;  /*< Get triggers list */

   virtual bool  get_table_comment(::String *str)=0; /*< Get table comment. */
   virtual bool  get_tablespace(::String *str)=0;  /*< Get tblspace name*/

      Get all kinds of constraints for this table:
      This includes: PrimaryKey, ForeignKey, Unique constraints.
   virtual Iterator_table_constraint  *get_constraints()=0;

   virtual Pkey  *get_primary_key()=0;       /*< Get Primary Key. */
   virtual Iterator_fkey *get_foreign_keys()=0;/*< Get Foreign keys */

   /* Get the list of unique constraints. Includes pkey if exists */
   virtual Iterator_ukey *get_unique_constraints()=0;

   /* Get auto-increment starting value. */
   virtual unsigned long long get_autoincrement()=0; 

     Get keyblock size in bytes. It is hint to storage engine.
     Value 0 indicates use of default. 
   virtual int  get_key_block_size()=0;

   /* Todo: Get partition info. */


   @typedef  Temp_table
   @brief    Temp_table is a special class of Base_table.

   Both Temp_table and Persistent_table are special cases of Base_table.
   They share most of the implementation.
   These interfaces are aliased to Base_table due to simplicity of 
   the implementation (as against creating new derived classes)
   Note:  Foreign keys in temp table are currently ignored.
typedef  Base_table  Temp_table;

   @typedef Persistent_table
   @brief   Persistent table is a special case of Base_table.

   Both Persistent_table and Temp_table are special cases of Base_table.
   They share most of the implementation.
   These interfaces are aliased to Base_table due to simplicity of 
   the implementation.
typedef  Base_table  Persistent_table;

   @class   View_table
   @brief   This represents view table which has definition in the database.
class  View_table : public Table {
    /* Get query expression */
    virtual ::query_model::Query_expression  *get_query_expr()=0;
    virtual int  get_sql(::String *str)=0;        /*< Get associated SQL */

   @class Index
   @brief Abstract class for Index.
      Note: An index may internally be created due to:
        1) "primary key" constraint specification 
        2) "unique" constraint specification 
        3) "foriegn key" constraint (if supported by storage engine)
        4) explicit index specification
   Non-unique indexes are always created as part of explicit specification.
   Explicit specification of index always creates new index and mysql 
   does not attempt to "share" internally generated indexes as part of 
   unique/pkey specification. 

   The index name and constraint name are same when the index is created
   for the constraint (either primary key, unique key or foreign key).

class Index : public ::model_common::Meta_object {


    virtual  Table *get_table()=0;             /*< Get associated table */
    virtual  Iterator_index_member *get_members()=0;/*< Get index members */
    virtual  bool  is_unique()=0;                /*< Is unique index? */
    virtual  bool  is_clustered()=0;             /*< Is clustered index? */
    virtual  bool  is_pkey_index()=0;            /*< Is primary key index?*/
    virtual  bool  is_system_generated()=0;      /*< System generated index?*/

      This returns associated source constraint for this index.
      Note: Single index can atmost be associated with single constraint:
            This could be primary or unique constraint.
            Non-unique index is not associated with any constraints
            and will return NULL.
    virtual  Table_constraint *get_index_constraint()=0;

      Enum type for index types. These are mutually exclusive:
      Primary : The index is primary index. The values must be unique.
      Unique  : A unique index which is not the primary. 
      Multiple: Non-unique regular index. values need not be unique.
                It is also not fulltext, spatial or foreign key index.
      Fulltext: Special type non-unique index for fulltext search. 
      Spatial : Special type non-unique index for spatial search. 
      ForeignKey: Special type non-unique index in referencing table
                  created for foreign key constraint.
    enum      Index_type  { INDEX_TYPE_PRIMARY, INDEX_TYPE_UNIQUE, 
                            INDEX_TYPE_MULTIPLE, INDEX_TYPE_FULLTEXT, 

    virtual  Index_type  get_index_type()=0; /*< Get index type. */

    enum Index_algo  { INDEX_ALGO_UNDEF=0,
                            INDEX_ALGO_FULLTEXT };

    virtual  Index_algo   get_index_algo()=0;  /*< Get Index Algorithm*/
      Get keyblock size in bytes. It is hint to storage engine.
      Value 0 indicates use of default. 
    virtual  long  get_key_block_size()=0;

   @class  Index_member
   @brief  This represents a single part of the index (in clustered index)
           If the clustered index has many components, there is one
           Index_member instance created for each component.
           For non-clustered index, there is only one Index_member.
class  Index_member : public  ::model_common::Meta_object {

public :

     virtual  Column   *get_column()=0;        /* Get associated column */
        Index may be created on leading part of column values.
        Return value of 0 indicates entire column is used for index.
     virtual int get_partial_length()=0; 
        Index member can be ascending or descending. 
        Currently it is always used as ascending in mysql.
     virtual bool  is_ascending()=0;

   @class  Table_constraint
   @brief  Abstract table constraint clause.

Note: Check SQL Standard 5WD-02-Foundation-2003-09 4.17 
      Integrity Constraints for more description about the constraints.
   Constraint  :=  Table Constraint | Domain Constraint | Assertion
    Table Constraint  :=  Involves one or more columns in a table
    Domain constraint :=  Restricted datatype e.g integer value > 3
                         can be used against any column
    Assertion         := Involves multiple tables

    MySQL currently supports table constraints only.

   MySQL assumes all constraints are non-deferrable and checked immediate.
   [ SQL standard supports the notion of constraint being either deferrable 
     or not. If deferrable, the current constraint mode can be
     "deferred" or "immediate". ]

   TableConstraint :- unique | referential(foreign_key) | check 

   unique-constraint(column-list) :- defined by:  "unique" | "primary key"
   referential-constraint(referencing-columns) :- 
      specifies referenced-table(referenced-columns);
      The <referenced-columns> should be of type "unique".
      The match type (full,partial,simple) defines semantics of match when 
      some columns can be null.
      The referential triggered action specifies what to do :
         i.e. ON delete|update  restrict|cascade|set-null|no-action 
      referenced table may be same as referencing table.

   check-constraint : constraint applied per row on a given table.
                      currently parsed and ignored by MySQL.

   unique key and primary key must be associated with an index.
   Foreign key constraint may have an associated index in
   referencing table if storage engine supports it.

class Table_constraint : public  ::model_common::Meta_object {


   /* Get associated base table. */
   virtual Base_table  *get_base_table()=0;
      Currently all MySQL constraints are not deferrable.
      so this always returns false for now.
   virtual bool is_deferrable() { return false; }

     For mysql, all constraints are not deferrable and 
     always checked immediate. So this always returns false for now.
   virtual bool is_initially_deferred() { return false; }

   enum  Constraint_type {

   /* Get constraint type :  unique | primary_key | foreign_key */
   virtual Constraint_type  get_constraint_type()=0;


  @class fkey
  @brief Abstract foreign key referential constraint 
class Fkey : public Table_constraint {


    /* Get associated referencing table. */
    virtual Base_table *get_referencing_table()=0;

    /* Get associated referenced table. */
    virtual Base_table *get_referenced_table()=0;

    /* Get referencing columns.  */
    virtual Iterator_column *get_referencing_columns()=0;

    /* Get referenced columns. */
    virtual Iterator_column *get_referenced_columns()=0;

       @enum  fkey_match_type
       @brief Match type for foreign key referential constraint.

       Match type provides semantics of match when some 
       referencing/referenced columns could be null.
    enum  Fkey_match_type { 
          Either all referencing columns are null or non-nulls. Every 
          non-null referencing column must match with a referenced column.
       /* Non-null values of referencing cols must match with referenced.*/
       /* If atleast one referencing column is NULL, no constraint imposed.
          Otherwise all non-null columns must match.
    virtual Fkey_match_type get_match_type()=0;

       @enum  Fkey_action_type
       @brief Referential action types for implementing foreign keys.
              The action specifies what to do after delete|update of the 
              referenced row. This could be one of: 
              The no-action is the default action type.
   enum Fkey_action_type {
        FKEY_NO_ACTION = 0,     /*< No action. */
        FKEY_RESTRICT = 1,      /*< Reject update/delete */
        FKEY_CASCADE = 2,       /*< Cascade update/delete */
        FKEY_SET_NULL = 3,      /*< Set referencing columns as null*/
        FKEY_SET_DEFAULT = 4    /*< Set referencing cols to def value*/

   /*  Returns action to take when a row in referenced table is deleted. */
   virtual Fkey_action_type  get_on_delete_action()=0;

   /*  Returns action to take when a row in referenced table is updated. */
   virtual Fkey_action_type  get_on_update_action()=0;


  @class Ukey
  @brief Abstract unique key constraint
class Ukey  : public Table_constraint {
public :
   virtual Index  *get_unique_index()=0;

   @typedef  Pkey  
   @brief    Abstract primary key constraint.

   Pkey (primary key) is a special case of Ukey (unique key)
   However they share most of the implementation.
   Pkey is type aliased to Ukey due to the simplicity of the implementation.
/*  typedef  Ukey  Pkey;  Already declared */

}  // End namespace db_model

#endif   //  MODEL_DB_OBJ_H

                Appendix A.  Eclipse SQL Model Objects 

A.1. Overview

      This summary provides the package hierarchies and the important
classes used in Eclipse SQL Model. Many lower level implementation classes
have been excluded in the interest of brevity.

A.2. Package Hierarchy

  The top level package is org.eclipse.datatools.modelbase.sql which
will be referred as "sql" package in the rest of this section.

    sql package contains following sub-packages :


A.3. Important Classes in  sql.accesscontrol package 

    interface   AuthorizationIdentifier
    interface   DoubleObjectPrivilege
    interface   Group
    interface   Privilege
    interface   Role
    interface   RoleAuthorization
    interface   SQLAccessControlFactory
    interface   SQLAccessControlPackage
    interface   TablePrivilege
    interface   User

A.4. Important Classes in  sql.constraints  package

interface       Assertion
interface       CheckConstraint
interface       Constraint
interface       ForeignKey
class           IncrementType
interface       Index
interface       IndexMember
class           MatchType
interface       PrimaryKey
interface       ReferenceConstraint
interface       SQLConstraintsFactory
interface       SQLConstraintsPackage
interface       TableConstraint
interface       UniqueConstraint

A.5. Important Classes in  sql.datatypes package

interface       ApproximateNumericDataType
interface       ArrayDataType
interface       AttributeDefinition
interface       BinaryStringDataType
interface       BooleanDataType
interface       CharacterSet
interface       CharacterStringDataType
class           CoercibilityType
interface       CollectionDataType
interface       ConstructedDataType
interface       DataLinkDataType
interface       DataType
interface       DateDataType
interface       DistinctUserDefinedType
interface       Domain
interface       ExactNumericDataType
interface       Field
interface       FixedPrecisionDataType
interface       IntegerDataType
class           IntegrityControlOption
interface       IntervalDataType
class           IntervalQualifierType
class           LinkControlOption
interface       MultisetDataType
interface       NumberDataType
interface       NumericalDataType
class           OrderingCategoryType
class           OrderingType
interface       PredefinedDataType
class           PrimitiveType
class           ReadPermissionOption
interface       ReferenceDataType
interface       RowDataType
interface       SQLDataType
interface       SQLDataTypesFactory
interface       SQLDataTypesPackage
interface       StructuredUserDefinedType
interface       TimeDataType
class           UnlinkOption
interface       UserDefinedType
interface       UserDefinedTypeOrdering
class           WritePermissionOption
interface       XMLDataType

A.6. Important Classes in  sql.expressions package

interface       QueryExpression
interface       QueryExpressionDefault
interface       SearchCondition
interface       SearchConditionDefault
interface       SQLExpressionsFactory
interface       SQLExpressionsPackage
interface       ValueExpression
interface       ValueExpressionDefault

A.7. Important Classes in  sql.routines package

interface       BuiltInFunction
class           DataAccess
interface       Function
interface       Method
interface       Parameter
class           ParameterMode
interface       Procedure
interface       Routine
interface       RoutineResultTable
interface       Source
interface       SQLRoutinesFactory
interface       SQLRoutinesPackage
interface       UserDefinedFunction

A.8. Important Classes in sql.schema Package

interface       Catalog
interface       Comment
interface       Database
interface       Dependency
interface       Event
class           GenerateType
interface       IdentitySpecifier
class           ReferentialActionType
interface       Schema
interface       Sequence
interface       SQLObject
interface       SQLSchemaFactory
interface       SQLSchemaPackage
interface       TypedElement

A.9. Important Classes in sql.statements Package

interface       SQLConnectionStatement
interface       SQLControlStatement
interface       SQLDataChangeStatement
interface       SQLDataStatement
interface       SQLDiagnosticsStatement
interface       SQLDynamicStatement
interface       SQLSchemaStatement
interface       SQLSessionStatement
interface       SQLStatement
interface       SQLStatementDefault
interface       SQLStatementsFactory
interface       SQLStatementsPackage
interface       SQLTransactionStatement

A.10. Important Classes in sql.Tables package

class           ActionGranularityType
class           ActionTimeType
interface       BaseTable
class           CheckType
interface       Column
interface       DerivedTable
interface       PersistentTable
class           ReferenceType
interface       SQLTablesFactory
interface       SQLTablesPackage
interface       Table
interface       TemporaryTable
interface       Trigger
interface       ViewTable

A.11. Important Classes in sql.query package

   interface    TableCorrelation
   interface    TableExpression
   interface    TableFunction
   interface    TableInDatabase
   interface    TableJoined
   class        TableJoinedOperator
   interface    TableNested
   interface    TableReference

   interface    SQLQueryObject

   interface    QueryChangeStatement
   interface    QueryCombined
   class        QueryCombinedOperator
   interface    QueryDeleteStatement
   interface    QueryExpressionBody
   interface    QueryExpressionRoot
   interface    QueryInsertStatement
   interface    QueryMergeStatement
   interface    QueryResultSpecification
   interface    QuerySearchCondition
   interface    QuerySelect
   interface    QuerySelectStatement
   interface    QueryStatement
   interface    QueryUpdateStatement
   interface    QueryValueExpression
   interface    QueryValues
   interface    ResultColumn
   interface    ResultTableAllColumns
   interface    SearchConditionCombined
   class        SearchConditionCombinedOperator
   interface    SearchConditionNested

   interface    ColumnName
   interface    GroupingExpression
   interface    Predicate

   interface    ValueExpressionSimple

   interface    SQLQueryModelFactory
   interface    SQLQueryModelPackage
   interface    CursorReference
   interface    Grouping
   interface    GroupingSets
   interface    GroupingSetsElement
   interface    GroupingSetsElementExpression
   interface    GroupingSetsElementSublist
   interface    GroupingSpecification
   class        NullOrderingType
   interface    OrderByOrdinal
   interface    OrderByResultColumn
   interface    OrderBySpecification
   interface    OrderByValueExpression
   class        OrderingSpecType
   interface    PredicateBasic
   interface    PredicateBetween
   class        PredicateComparisonOperator
   interface    PredicateExists
   interface    PredicateIn
   interface    PredicateInValueList
   interface    PredicateInValueRowSelect
   interface    PredicateInValueSelect
   interface    PredicateIsNull
   interface    PredicateLike
   interface    PredicateQuantified
   interface    PredicateQuantifiedRowSelect
   class        PredicateQuantifiedType
   interface    PredicateQuantifiedValueSelect
   interface    SuperGroup
   interface    SuperGroupElement
   interface    SuperGroupElementExpression
   interface    SuperGroupElementSublist
   class        SuperGroupType
   interface    UpdateAssignmentExpression
   interface    UpdateSource
   interface    UpdateSourceExprList
   interface    UpdateSourceQuery
   interface    ValueExpressionAtomic
   interface    ValueExpressionCase
   interface    ValueExpressionCaseElse
   interface    ValueExpressionCaseSearch
   interface    ValueExpressionCaseSearchContent
   interface    ValueExpressionCaseSimple
   interface    ValueExpressionCaseSimpleContent
   interface    ValueExpressionCast
   interface    ValueExpressionColumn
   interface    ValueExpressionCombined
   class        ValueExpressionCombinedOperator
   interface    ValueExpressionDefaultValue
   interface    ValueExpressionFunction
   interface    ValueExpressionLabeledDuration
   class        ValueExpressionLabeledDurationType
   interface    ValueExpressionNested
   interface    ValueExpressionNullValue
   interface    ValueExpressionScalarSelect
   class        ValueExpressionUnaryOperator
   interface    ValueExpressionVariable
   interface    ValuesRow
   interface    WithTableReference
   interface    WithTableSpecification