Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Constraints are rendered using PMSFormula. Each WhereCondition class contains a PMSFormula object which manages the SQL rendering. Constraints are parsed and resolved before SQL generation, to determine which business tables are referenced. This is an important step so that the Join algorithm contains the correct set of tables.

 Extending MQL 

Specifying your own MQLQuery class

The default MQLQuery behavior may be extended or replaced.  To accomplish this:

Step 1

Extend MQLQueryImpl or implement the MQLQuery interface

Step 2

Make sure to have a constructor with the following signature:
            (String XML, DatabaseMeta databaseMeta, String locale, CwmSchemaFactoryInterface factory)

Step 3

Either pass in the fully qualified class name into MQLQueryFactory.getMQLQuery(),
            or set the system property "org.pentaho.pms.mql.MQLQueryClassName" to your
            fully qualified path.

Extending MQLQueryImpl

To easily add modifications or additional information to the MQL XML syntax, one must extend MQLQueryImpl, SQLGenerator and PMSFormula.  The MQL Query Model can be extended by overriding specific methods within these classes.  In the org.pentaho.pms.example package, an AdvancedMQLQuery class is available that demonstrates the extension of Selections XML parsing.