| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ws.jaxme.sqls.impl.SQLGeneratorImpl
Default implementation of an SQL generator.
| Constructor Summary | |
| SQLGeneratorImpl() | |
| Method Summary | |
| protected  java.lang.String | createForeignKeyAsPartOfCreateTable(ForeignKey pKey) | 
| protected  java.lang.String | createIndexAsPartOfCreateTable(Index pIndex) | 
| protected  java.lang.String | createPrimaryKeyAsPartOfCreateTable(Table pTable) | 
| protected  java.lang.String | getBooleanConstraint(SelectStatementMetaData pData,
                     BooleanConstraint pConstraint) | 
| protected  java.lang.String | getBooleanConstraintPart(SelectStatementMetaData pData,
                         java.lang.Object o) | 
| protected  java.lang.String | getBooleanConstraintType(BooleanConstraint.Type pType) | 
| protected  java.lang.String | getColumnAlias(SelectStatementMetaData pData,
               ColumnReference pColumn) | 
| protected  java.lang.String | getColumnAlias(SelectStatementMetaData pData,
               ColumnReference[] pColumn) | 
| protected  java.lang.String | getCombinedConstraint(SelectStatementMetaData pData,
                      CombinedConstraint pConstraint) | 
|  java.lang.String | getConstraint(Constraint pConstraint)Generates the WHERE clause of a SELECT, UPDATE, or DELETE statement. | 
|  java.lang.String | getConstraint(SelectStatementMetaData pData,
              Constraint pConstraint) | 
| protected  java.lang.String | getCreate(Column pColumn) | 
|  java.util.Collection | getCreate(ForeignKey pKey)Generates a CREATE FOREIGN KEY statement. | 
|  java.util.Collection | getCreate(Index pIndex)Generates a CREATE INDEX statement. | 
|  java.util.Collection | getCreate(Schema pSchema)Generates a CREATE SCHEMAstatement. | 
|  java.util.Collection | getCreate(Schema pSchema,
          boolean pAll)Generates CREATEstatements for the schema. | 
|  java.util.Collection | getCreate(Table pTable)Generates a CREATE TABLE statement. | 
|  java.util.Collection | getCreate(Table pTable,
          boolean pAll)Generates CREATEstatements for the table. | 
| protected  java.lang.String | getCreateTableHeader(Table pTable) | 
| protected  java.lang.String | getDeleteQuery(DeleteStatement pQuery) | 
|  java.util.Collection | getDrop(ForeignKey pKey)Generates a DROP FOEIGN KEY statement. | 
|  java.util.Collection | getDrop(Index pIndex)Generates a DROP INDEX statement. | 
|  java.util.Collection | getDrop(Schema pSchema)Generates a DROP SCHEMA statement. | 
|  java.util.Collection | getDrop(Schema pSchema,
        boolean pAll)Generates DROPstatements for the schema. | 
|  java.util.Collection | getDrop(Table pTable)Generates a DROP TABLE statement. | 
|  java.util.Collection | getDrop(Table pTable,
        boolean pAll)Generates DROPstatements for the table. | 
| protected  java.lang.String | getEscapedString(java.lang.String s) | 
| protected  java.lang.String | getFunction(SelectStatementMetaData pData,
            Function f) | 
| protected  java.lang.String | getIndent() | 
|  java.lang.String | getInsertQuery(InsertStatement pQuery) | 
| protected  java.lang.String | getJoinAlias(SelectStatementMetaData pData,
             JoinReference pJoinReference) | 
|  java.lang.String | getLineTerminator()Returns the line terminator. | 
| protected  java.lang.String | getParts(SelectStatementMetaData pData,
         java.util.Iterator pParts) | 
|  java.lang.String | getQuery(Statement pStatement)Generates an INSERT, UPDATE, DELETE or SELECT statement. | 
| protected  java.lang.String | getSelectQuery(SelectStatement pQuery) | 
| protected  java.lang.String | getSelectQuery(SelectStatement pQuery,
               SelectStatementMetaData pData) | 
| protected  java.lang.String | getSelectQueryConstraints(SelectStatement pQuery,
                          SelectStatementMetaData pData,
                          SelectStatementMetaData.LocalData pLocalData) | 
| protected  java.lang.String | getSelectQueryFromClause(SelectStatement pQuery,
                         SelectStatementMetaData pData) | 
| protected  java.lang.String | getSelectQueryOrderClause(SelectStatementMetaData pData,
                          SelectStatement pQuery) | 
| protected  java.lang.String | getSelectQueryResultColumns(SelectStatement pQuery,
                            SelectStatementMetaData pData) | 
|  java.lang.String | getStatementTerminator()Returns the statement terminator. | 
| protected  java.lang.String | getTableAlias(SelectStatementMetaData pData,
              TableReference pTable) | 
| protected  java.lang.String | getTypeName(Column.Type pType) | 
| protected  java.lang.String | getUpdateQuery(UpdateStatement pQuery) | 
| protected  java.lang.String | getValue(Value pValue) | 
|  java.lang.String | getWhereClause(SelectStatement pQuery)Returns the WHERE ... | 
| protected  java.lang.String | getWhereClause(SelectStatementMetaData pData,
               CombinedConstraint pWhereClause) | 
| protected  boolean | isForeignKeyPartOfCreateTable()Returns whether a CREATE TABLEstatement may contain
 aFOREIGN KEYclause. | 
| protected  boolean | isNonUniqueIndexPartOfCreateTable()Returns whether a CREATE TABLEstatement may contain
 anINDEXclause. | 
| protected  boolean | isPrimaryKeyPartOfCreateTable()Returns whether a CREATE TABLEstatement may contain
 aPRIMARY KEYclause. | 
| protected  boolean | isPrimaryKeyUniqueIndex()Returns whether the primary key requires special handling (in which case isPrimaryKeyPartOfCreateTable()andcreatePrimaryKeyAsPartOfCreateTable(Table)are used)
 or nor (in which caseisUniqueIndexPartOfCreateTable()andcreateIndexAsPartOfCreateTable(Index)apply). | 
| protected  boolean | isQualifiedColumn(SelectStatementMetaData pData,
                  ColumnReference pColumn) | 
| protected  boolean | isTableAliasUsingAs() | 
| protected  boolean | isUniqueIndexPartOfCreateTable()Returns whether a CREATE TABLEstatement may contain
 aUNIQUEclause. | 
| protected  SelectStatementMetaData | newSelectStatementMetaData(SelectStatement pQuery) | 
| protected  java.lang.String | newStatement(java.lang.String pStatement) | 
|  void | setLineTerminator(java.lang.String pLineTerminator)Sets the line terminator. | 
|  void | setStatementTerminator(java.lang.String pStatementTerminator)Sets the statement terminator. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public SQLGeneratorImpl()
| Method Detail | 
public java.lang.String getStatementTerminator()
SQLGeneratorReturns the statement terminator. A non-null value will be appended to all generated statements. Defaults to null.
getStatementTerminator in interface SQLGeneratorpublic void setStatementTerminator(java.lang.String pStatementTerminator)
SQLGeneratorSets the statement terminator. A non-null value will be appended to all generated statements. Defaults to null.
setStatementTerminator in interface SQLGeneratorpublic java.lang.String getLineTerminator()
SQLGeneratorReturns the line terminator. A non-null value indicates that the generated statements should be made human readable by splitting them over multiple lines. A null value ensures that a statement consists of a single line only. Defaults to "\n".
getLineTerminator in interface SQLGeneratorpublic void setLineTerminator(java.lang.String pLineTerminator)
SQLGeneratorSets the line terminator. A non-null value indicates that the generated statements should be made human readable by splitting them over multiple lines. A null value ensures that a statement consists of a single line only. Defaults to "\n".
setLineTerminator in interface SQLGeneratorprotected java.lang.String newStatement(java.lang.String pStatement)
public java.util.Collection getCreate(Schema pSchema)
SQLGeneratorGenerates a CREATE SCHEMA statement. Doesn't create
 CREATE TABLE or similar statements.
getCreate in interface SQLGeneratorpublic java.util.Collection getDrop(Schema pSchema)
SQLGeneratorGenerates a DROP SCHEMA statement. Doesn't create
 DROP TABLE or similar statements.
getDrop in interface SQLGeneratorprotected java.lang.String getIndent()
protected java.lang.String getTypeName(Column.Type pType)
protected java.lang.String getCreate(Column pColumn)
protected boolean isPrimaryKeyUniqueIndex()
Returns whether the primary key requires special handling
 (in which case isPrimaryKeyPartOfCreateTable() and
 createPrimaryKeyAsPartOfCreateTable(Table) are used)
 or nor (in which case isUniqueIndexPartOfCreateTable()
 and createIndexAsPartOfCreateTable(Index) apply).
protected boolean isPrimaryKeyPartOfCreateTable()
Returns whether a CREATE TABLE statement may contain
 a PRIMARY KEY clause.
protected boolean isUniqueIndexPartOfCreateTable()
Returns whether a CREATE TABLE statement may contain
 a UNIQUE clause.
protected boolean isNonUniqueIndexPartOfCreateTable()
Returns whether a CREATE TABLE statement may contain
 an INDEX clause.
protected boolean isForeignKeyPartOfCreateTable()
Returns whether a CREATE TABLE statement may contain
 a FOREIGN KEY clause.
protected java.lang.String createPrimaryKeyAsPartOfCreateTable(Table pTable)
protected java.lang.String createIndexAsPartOfCreateTable(Index pIndex)
protected java.lang.String createForeignKeyAsPartOfCreateTable(ForeignKey pKey)
protected java.lang.String getCreateTableHeader(Table pTable)
public java.util.Collection getCreate(Table pTable)
SQLGeneratorGenerates a CREATE TABLE statement. Doesn't create
 CREATE INDEX or similar statements.
getCreate in interface SQLGeneratorpublic java.util.Collection getDrop(Table pTable)
SQLGeneratorGenerates a DROP TABLE statement. Doesn't create
 DROP INDEX or similar statements.
getDrop in interface SQLGeneratorpublic java.lang.String getInsertQuery(InsertStatement pQuery)
protected java.lang.String getValue(Value pValue)
protected java.lang.String getUpdateQuery(UpdateStatement pQuery)
protected java.lang.String getDeleteQuery(DeleteStatement pQuery)
protected boolean isQualifiedColumn(SelectStatementMetaData pData,
                                    ColumnReference pColumn)
protected java.lang.String getFunction(SelectStatementMetaData pData,
                                       Function f)
protected java.lang.String getColumnAlias(SelectStatementMetaData pData,
                                          ColumnReference pColumn)
protected java.lang.String getColumnAlias(SelectStatementMetaData pData,
                                          ColumnReference[] pColumn)
protected boolean isTableAliasUsingAs()
protected java.lang.String getTableAlias(SelectStatementMetaData pData,
                                         TableReference pTable)
protected java.lang.String getJoinAlias(SelectStatementMetaData pData,
                                        JoinReference pJoinReference)
protected java.lang.String getEscapedString(java.lang.String s)
protected java.lang.String getParts(SelectStatementMetaData pData,
                                    java.util.Iterator pParts)
protected java.lang.String getBooleanConstraintPart(SelectStatementMetaData pData,
                                                    java.lang.Object o)
protected java.lang.String getBooleanConstraintType(BooleanConstraint.Type pType)
protected java.lang.String getBooleanConstraint(SelectStatementMetaData pData,
                                                BooleanConstraint pConstraint)
protected java.lang.String getCombinedConstraint(SelectStatementMetaData pData,
                                                 CombinedConstraint pConstraint)
public java.lang.String getConstraint(SelectStatementMetaData pData,
                                      Constraint pConstraint)
protected java.lang.String getWhereClause(SelectStatementMetaData pData,
                                          CombinedConstraint pWhereClause)
protected java.lang.String getSelectQuery(SelectStatement pQuery)
protected java.lang.String getSelectQueryResultColumns(SelectStatement pQuery,
                                                       SelectStatementMetaData pData)
protected java.lang.String getSelectQueryFromClause(SelectStatement pQuery,
                                                    SelectStatementMetaData pData)
protected java.lang.String getSelectQueryConstraints(SelectStatement pQuery,
                                                     SelectStatementMetaData pData,
                                                     SelectStatementMetaData.LocalData pLocalData)
protected java.lang.String getSelectQuery(SelectStatement pQuery,
                                          SelectStatementMetaData pData)
protected java.lang.String getSelectQueryOrderClause(SelectStatementMetaData pData,
                                                     SelectStatement pQuery)
public java.lang.String getQuery(Statement pStatement)
SQLGeneratorGenerates an INSERT, UPDATE, DELETE or SELECT statement.
getQuery in interface SQLGenerator
public java.util.Collection getCreate(Schema pSchema,
                                      boolean pAll)
SQLGeneratorGenerates CREATE statements for the schema.
getCreate in interface SQLGeneratorpAll - If this parameter is set to true, then the method is
    equivalent to  SQLGenerator.getCreate(Schema). Otherwise the returned
    collection will also include CREATE statements for
    all the tables and indexes in the schema. These additional statements
    are created by invoking SQLGenerator.getCreate(Table,boolean) for all the
    tables in the schema.
public java.util.Collection getDrop(Schema pSchema,
                                    boolean pAll)
SQLGeneratorGenerates DROP statements for the schema.
getDrop in interface SQLGeneratorpAll - If this parameter is set to true, then the method is
    equivalent to  SQLGenerator.getDrop(Schema). Otherwise the returned
    collection will also include DROP statements for
    all the tables and indexes in the schema. These additional statements
    are created by invoking SQLGenerator.getDrop(Table,boolean) for all the
    tables in the schema.
public java.util.Collection getCreate(Table pTable,
                                      boolean pAll)
SQLGeneratorGenerates CREATE statements for the table.
getCreate in interface SQLGeneratorpAll - If this parameter is set to true, then the method is
    equivalent to  SQLGenerator.getCreate(Table). Otherwise the returned
    collection will also include CREATE statements for
    the indexes, which are defined on the table. These additional
    statements are created by invoking SQLGenerator.getCreate(Index)
    and SQLGenerator.getCreate(ForeignKey) for all the indexes in the
    schema.
public java.util.Collection getDrop(Table pTable,
                                    boolean pAll)
SQLGeneratorGenerates DROP statements for the table.
getDrop in interface SQLGeneratorpAll - If this parameter is set to true, then the method is
    equivalent to  SQLGenerator.getDrop(Table). Otherwise the returned
    collection will also include DROP statements for
    the indexes, which are defined on the table. These additional
    statements are created by invoking SQLGenerator.getDrop(Index)
    and SQLGenerator.getDrop(ForeignKey) for all the indexes in the
    schema.public java.util.Collection getCreate(Index pIndex)
SQLGeneratorGenerates a CREATE INDEX statement.
getCreate in interface SQLGeneratorpublic java.util.Collection getDrop(Index pIndex)
SQLGeneratorGenerates a DROP INDEX statement.
getDrop in interface SQLGeneratorpublic java.util.Collection getCreate(ForeignKey pKey)
SQLGeneratorGenerates a CREATE FOREIGN KEY statement.
getCreate in interface SQLGeneratorpublic java.util.Collection getDrop(ForeignKey pKey)
SQLGeneratorGenerates a DROP FOEIGN KEY statement.
getDrop in interface SQLGeneratorprotected SelectStatementMetaData newSelectStatementMetaData(SelectStatement pQuery)
public java.lang.String getWhereClause(SelectStatement pQuery)
SQLGeneratorReturns the WHERE ... ORDER BY ... part
 of the SELECT statement.
getWhereClause in interface SQLGeneratorpublic java.lang.String getConstraint(Constraint pConstraint)
SQLGeneratorGenerates the WHERE clause of a SELECT, UPDATE, or DELETE statement.
getConstraint in interface SQLGenerator| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||