org.eclipse.datatools.modelbase.sql.query.util
Class SQLQuerySourceWriter

java.lang.Object
  extended byorg.eclipse.datatools.modelbase.sql.query.util.SQLQuerySourceWriter
All Implemented Interfaces:
SQLSourceWriter
Direct Known Subclasses:
SQLXMLQuerySourceWriter

public class SQLQuerySourceWriter
extends java.lang.Object
implements SQLSourceWriter

The SQLQuerySourceWriter provides a generic getSQL() method to generate the SQL source text of a given queryObject in the package org.eclipse.datatools.modelbase.sql.query.

Author:
ckadner
See Also:

Developer note: To extend this SQLQuerySourceWriter for another org.eclipse.datatools.modelbase.sql.query package, the following naming conventions have to be adhered to. The package name containing the SQLQueryObjects must contain the part name sql.query, e.g. org.eclipse.datatools.modelbase.sql.query.db2.luw. The SQLQuerySourceWriter for that package must be under the sub- package util, likewise org.eclipse.datatools.modelbase.sql.query.db2.luw.util The name of the SQLQuerySourceWriter class must be composed of at least the last part of the SQLQueryObjects' package name and the word "SourceWriter", e.g. for an SQLQueryObject in package org.eclipse.datatools.modelbase.sql.query.db2.luw the appropriate SQLQuerySourceWriter class could be org.eclipse.datatools.modelbase.sql.query.db2.luw.util.DB2LUWSourceWriter or org.eclipse.datatools.modelbase.sql.query.db2.luw.util.LUWSourceWriter. The SQLQuerySourceWriter could also be capable of generatiing the SQL source text of multiple SQLQueryObjects' packages and consequently would have to be located in a higher package itself. Likewise a org.eclipse.datatools.modelbase.sql.query.db2.util.DB2SourceWriter could be capable of generatiing the SQL source text for the packages org.eclipse.datatools.modelbase.sql.query.db2 and org.eclipse.datatools.modelbase.sql.query.db2.luw and org.eclipse.datatools.modelbase.sql.query.db2.zos and org.eclipse.datatools.modelbase.sql.query.db2.cloudscape.

There can be only one SQLQuerySourceWriter per SQLQueryObject package!

A SQLQuerySourceWriter operates on interface level TODO: ckadner finish! please crab me for that! SORRY -- time's short! TODO: clear up comment Developer note: add only appendSQL methods that apply to specific SQLQueryObjects so the runtime type will decide its invocation, an invokation of appendSQL() should always be compiletime-bound to appendSQL(SQLQueryObject, StrinBuffer) that via reflection then invokes the right appendSQL method. Unless: you know the exact runtime type and this type has no subtypes with special features or source generation, that are formatted by another appendSQL method here


Field Summary
static java.lang.String DEFAULT_STMT_SELECT
          String constant, used as SQL source for empty QuerySelectStatement, value: "SELECT * FROM"
 
Constructor Summary
SQLQuerySourceWriter()
           
 
Method Summary
 java.lang.String getSQL(SQLQueryObject queryObject)
          Generic method to return the SQL source of ther given queryObject.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STMT_SELECT

public static final java.lang.String DEFAULT_STMT_SELECT
String constant, used as SQL source for empty QuerySelectStatement, value: "SELECT * FROM"

See Also:
Constant Field Values
Constructor Detail

SQLQuerySourceWriter

public SQLQuerySourceWriter()
Method Detail

getSQL

public java.lang.String getSQL(SQLQueryObject queryObject)
Generic method to return the SQL source of ther given queryObject.

Specified by:
getSQL in interface SQLSourceWriter
Parameters:
queryObject -
Returns:


Copyright © 2007 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.