net.sf.jaxme.sqls.db2
Class DB2SQLGeneratorImpl

java.lang.Object
  extended bynet.sf.jaxme.sqls.impl.SQLGeneratorImpl
      extended bynet.sf.jaxme.sqls.db2.DB2SQLGeneratorImpl
All Implemented Interfaces:
DB2SQLGenerator, SQLGenerator

public class DB2SQLGeneratorImpl
extends SQLGeneratorImpl
implements DB2SQLGenerator

Default implementation of an SQL generator for DB2 schemas.

Author:
Jochen Wiedmann

Constructor Summary
DB2SQLGeneratorImpl()
           
 
Method Summary
 java.util.Collection getCreate(BufferPool pBufferPool)
          Returns an SQL statement creating the given BufferPool.
protected  java.lang.String getCreate(Column pColumn)
           
 java.util.Collection getCreate(TableSpace pTableSpace)
          Returns an SQL statement creating the given TableSpace.
protected  java.lang.String getCreateTableHeader(Table pTable)
           
 java.util.Collection getDrop(BufferPool pBufferPool)
          Returns an SQL statement dropping the given BufferPool.
 java.util.Collection getDrop(Schema pSchema)
          Generates a DROP SCHEMA statement.
 java.util.Collection getDrop(TableSpace pTableSpace)
          Returns an SQL statement dropping the given TableSpace.
protected  java.lang.String getTypeName(Column.Type pType)
           
 boolean isCreatingTableSpaceReferences()
          Returns whether CREATE TABLE statements will contain table space references or not.
protected  boolean isForeignKeyPartOfCreateTable()
          Returns whether a CREATE TABLE statement may contain a FOREIGN KEY clause.
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.
 void setCreatingTableSpaceReferences(boolean pCreatingTableSpaceReferences)
          Sets whether CREATE TABLE statements will contain table space references or not.
 
Methods inherited from class net.sf.jaxme.sqls.impl.SQLGeneratorImpl
createForeignKeyAsPartOfCreateTable, createIndexAsPartOfCreateTable, createPrimaryKeyAsPartOfCreateTable, getBooleanConstraint, getBooleanConstraintPart, getBooleanConstraintType, getColumnAlias, getColumnAlias, getCombinedConstraint, getConstraint, getCreate, getCreate, getCreate, getCreate, getCreate, getCreate, getDeleteQuery, getDrop, getDrop, getDrop, getDrop, getDrop, getEscapedString, getIndent, getInsertQuery, getJoinAlias, getLineTerminator, getQuery, getSelectQuery, getStatementTerminator, getTableAlias, getUpdateQuery, getValue, getWhereClause, isNonUniqueIndexPartOfCreateTable, isPrimaryKeyUniqueIndex, newStatement, setLineTerminator, setStatementTerminator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jaxme.sqls.SQLGenerator
getConstraint, getCreate, getCreate, getCreate, getCreate, getCreate, getCreate, getDrop, getDrop, getDrop, getDrop, getDrop, getLineTerminator, getQuery, getStatementTerminator, setLineTerminator, setStatementTerminator
 

Constructor Detail

DB2SQLGeneratorImpl

public DB2SQLGeneratorImpl()
Method Detail

isPrimaryKeyPartOfCreateTable

protected boolean isPrimaryKeyPartOfCreateTable()
Description copied from class: SQLGeneratorImpl

Returns whether a CREATE TABLE statement may contain a PRIMARY KEY clause.

Overrides:
isPrimaryKeyPartOfCreateTable in class SQLGeneratorImpl

isUniqueIndexPartOfCreateTable

protected boolean isUniqueIndexPartOfCreateTable()
Description copied from class: SQLGeneratorImpl

Returns whether a CREATE TABLE statement may contain a UNIQUE clause.

Overrides:
isUniqueIndexPartOfCreateTable in class SQLGeneratorImpl

isForeignKeyPartOfCreateTable

protected boolean isForeignKeyPartOfCreateTable()
Description copied from class: SQLGeneratorImpl

Returns whether a CREATE TABLE statement may contain a FOREIGN KEY clause.

Overrides:
isForeignKeyPartOfCreateTable in class SQLGeneratorImpl

setCreatingTableSpaceReferences

public void setCreatingTableSpaceReferences(boolean pCreatingTableSpaceReferences)

Sets whether CREATE TABLE statements will contain table space references or not. The default is to create table space references.

Specified by:
setCreatingTableSpaceReferences in interface DB2SQLGenerator

isCreatingTableSpaceReferences

public boolean isCreatingTableSpaceReferences()

Returns whether CREATE TABLE statements will contain table space references or not. The default is to create table space references.

Specified by:
isCreatingTableSpaceReferences in interface DB2SQLGenerator

getTypeName

protected java.lang.String getTypeName(Column.Type pType)
Overrides:
getTypeName in class SQLGeneratorImpl

getCreate

public java.util.Collection getCreate(BufferPool pBufferPool)
Description copied from interface: DB2SQLGenerator

Returns an SQL statement creating the given BufferPool.

Specified by:
getCreate in interface DB2SQLGenerator

getDrop

public java.util.Collection getDrop(BufferPool pBufferPool)
Description copied from interface: DB2SQLGenerator

Returns an SQL statement dropping the given BufferPool.

Specified by:
getDrop in interface DB2SQLGenerator

getCreate

public java.util.Collection getCreate(TableSpace pTableSpace)
Description copied from interface: DB2SQLGenerator

Returns an SQL statement creating the given TableSpace.

Specified by:
getCreate in interface DB2SQLGenerator

getDrop

public java.util.Collection getDrop(TableSpace pTableSpace)
Description copied from interface: DB2SQLGenerator

Returns an SQL statement dropping the given TableSpace.

Specified by:
getDrop in interface DB2SQLGenerator

getCreateTableHeader

protected java.lang.String getCreateTableHeader(Table pTable)
Overrides:
getCreateTableHeader in class SQLGeneratorImpl

getCreate

protected java.lang.String getCreate(Column pColumn)
Overrides:
getCreate in class SQLGeneratorImpl

getDrop

public java.util.Collection getDrop(Schema pSchema)
Description copied from interface: SQLGenerator

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

Specified by:
getDrop in interface SQLGenerator
Overrides:
getDrop in class SQLGeneratorImpl