org.apache.ws.jaxme.sqls
Interface SQLGenerator

All Known Subinterfaces:
DB2SQLGenerator, HsqlDbSQLGenerator, OraSQLGenerator
All Known Implementing Classes:
DB2SQLGeneratorImpl, HsqlDbSQLGeneratorImpl, OraSQLGeneratorImpl, SQLGeneratorImpl

public interface SQLGenerator

An SQL generator.

Author:
Jochen Wiedmann

Method Summary
 java.lang.String getConstraint(Constraint pConstraint)
          Generates the WHERE clause of a SELECT, UPDATE, or DELETE statement.
 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 SCHEMA statement.
 java.util.Collection getCreate(Schema pSchema, boolean pAll)
          Generates CREATE statements for the schema.
 java.util.Collection getCreate(Table pTable)
          Generates a CREATE TABLE statement.
 java.util.Collection getCreate(Table pTable, boolean pAll)
          Generates CREATE statements for the table.
 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 DROP statements for the schema.
 java.util.Collection getDrop(Table pTable)
          Generates a DROP TABLE statement.
 java.util.Collection getDrop(Table pTable, boolean pAll)
          Generates DROP statements for the table.
 java.lang.String getLineTerminator()
          Returns the line terminator.
 java.lang.String getQuery(Statement pStatement)
          Generates an INSERT, UPDATE, DELETE or SELECT statement.
 java.lang.String getStatementTerminator()
          Returns the statement terminator.
 java.lang.String getWhereClause(SelectStatement pQuery)
          Returns the WHERE ...
 void setLineTerminator(java.lang.String pTerminator)
          Sets the line terminator.
 void setStatementTerminator(java.lang.String pTerminator)
          Sets the statement terminator.
 

Method Detail

getCreate

java.util.Collection getCreate(Schema pSchema)

Generates a CREATE SCHEMA statement. Doesn't create CREATE TABLE or similar statements.


getCreate

java.util.Collection getCreate(Schema pSchema,
                               boolean pAll)

Generates CREATE statements for the schema.

Parameters:
pAll - If this parameter is set to true, then the method is equivalent to 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 getCreate(Table,boolean) for all the tables in the schema.


getDrop

java.util.Collection getDrop(Schema pSchema)

Generates a DROP SCHEMA statement. Doesn't create DROP TABLE or similar statements.


getDrop

java.util.Collection getDrop(Schema pSchema,
                             boolean pAll)

Generates DROP statements for the schema.

Parameters:
pAll - If this parameter is set to true, then the method is equivalent to 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 getDrop(Table,boolean) for all the tables in the schema.


getCreate

java.util.Collection getCreate(Table pTable)

Generates a CREATE TABLE statement. Doesn't create CREATE INDEX or similar statements.


getCreate

java.util.Collection getCreate(Table pTable,
                               boolean pAll)

Generates CREATE statements for the table.

Parameters:
pAll - If this parameter is set to true, then the method is equivalent to 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 getCreate(Index) and getCreate(ForeignKey) for all the indexes in the schema.


getDrop

java.util.Collection getDrop(Table pTable)

Generates a DROP TABLE statement. Doesn't create DROP INDEX or similar statements.


getDrop

java.util.Collection getDrop(Table pTable,
                             boolean pAll)

Generates DROP statements for the table.

Parameters:
pAll - If this parameter is set to true, then the method is equivalent to 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 getDrop(Index) and getDrop(ForeignKey) for all the indexes in the schema.


getCreate

java.util.Collection getCreate(Index pIndex)

Generates a CREATE INDEX statement.


getDrop

java.util.Collection getDrop(Index pIndex)

Generates a DROP INDEX statement.


getCreate

java.util.Collection getCreate(ForeignKey pKey)

Generates a CREATE FOREIGN KEY statement.


getDrop

java.util.Collection getDrop(ForeignKey pKey)

Generates a DROP FOEIGN KEY statement.


getQuery

java.lang.String getQuery(Statement pStatement)

Generates an INSERT, UPDATE, DELETE or SELECT statement.


getConstraint

java.lang.String getConstraint(Constraint pConstraint)

Generates the WHERE clause of a SELECT, UPDATE, or DELETE statement.


getWhereClause

java.lang.String getWhereClause(SelectStatement pQuery)

Returns the WHERE ... ORDER BY ... part of the SELECT statement.


setStatementTerminator

void setStatementTerminator(java.lang.String pTerminator)

Sets the statement terminator. A non-null value will be appended to all generated statements. Defaults to null.


getStatementTerminator

java.lang.String getStatementTerminator()

Returns the statement terminator. A non-null value will be appended to all generated statements. Defaults to null.


setLineTerminator

void setLineTerminator(java.lang.String pTerminator)

Sets 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

java.lang.String getLineTerminator()

Returns 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".