edu.internet2.middleware.grouper.ddl
Class DdlVersionBean

java.lang.Object
  extended by edu.internet2.middleware.grouper.ddl.DdlVersionBean

public class DdlVersionBean
extends Object

bean to pass to versions to update stuff


Constructor Summary
DdlVersionBean(String objectName, org.apache.ddlutils.Platform platform, Connection connection, String schema, org.apache.ddlutils.platform.SqlBuilder sqlBuilder, org.apache.ddlutils.model.Database oldDatabase, org.apache.ddlutils.model.Database database, StringBuilder additionalScripts, boolean isDestinationVersion, int buildingToVersion, StringBuilder fullScript)
          construct
 
Method Summary
 void appendAdditionalScriptUnique(String script)
          append an additionalScript, but only if it is not already in the body of the script (or additionalScript)
 StringBuilder getAdditionalScripts()
          additional scripts to add after ddlutils scripts
 int getBuildingToVersion()
          the eventual version we are build to
 Connection getConnection()
          jdbc connection
 org.apache.ddlutils.model.Database getDatabase()
          database we are operating on
 StringBuilder getFullScript()
          full script so far (to make sure we dont have duplicate scripts, shouldnt add directly to it from here though
 String getObjectName()
          ddl object name (e.g.
 org.apache.ddlutils.model.Database getOldDatabase()
          current state of the database (after modifications :) ).
 org.apache.ddlutils.Platform getPlatform()
          ddlutils platform
 String getSchema()
          schema
 org.apache.ddlutils.platform.SqlBuilder getSqlBuilder()
          ddlutils schemabuilder
 boolean isDestinationVersion()
           
 boolean isHsql()
           
 boolean isMysql()
           
 boolean isOracle()
           
 boolean isPostgres()
           
 boolean isSmallIndexes()
          if small indexes
 boolean isSqlServer()
           
 void setAdditionalScripts(StringBuilder additionalScripts)
          additional scripts to add after ddlutils scripts
 void setBuildingToVersion(int buildingToVersion)
          the eventual version we are build to
 void setConnection(Connection connection)
          jdbc connection
 void setDatabase(org.apache.ddlutils.model.Database database)
          database we are operating on
 void setDestinationVersion(boolean isDestinationVersion)
           
 void setFullScript(StringBuilder fullScript)
          full script so far (to make sure we dont have duplicate scripts, shouldnt add directly to it from here though
 void setObjectName(String objectName)
          ddl object name (e.g.
 void setOldDatabase(org.apache.ddlutils.model.Database oldDatabase)
          current state of the database (after modifications :) ).
 void setPlatform(org.apache.ddlutils.Platform platform)
          ddlutils platform
 void setSchema(String schema)
          schema
 void setSqlBuilder(org.apache.ddlutils.platform.SqlBuilder sqlBuilder)
          ddlutils schemabuilder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DdlVersionBean

public DdlVersionBean(String objectName,
                      org.apache.ddlutils.Platform platform,
                      Connection connection,
                      String schema,
                      org.apache.ddlutils.platform.SqlBuilder sqlBuilder,
                      org.apache.ddlutils.model.Database oldDatabase,
                      org.apache.ddlutils.model.Database database,
                      StringBuilder additionalScripts,
                      boolean isDestinationVersion,
                      int buildingToVersion,
                      StringBuilder fullScript)
construct

Parameters:
objectName -
platform -
connection -
schema -
sqlBuilder -
oldDatabase -
database -
additionalScripts -
isDestinationVersion -
buildingToVersion -
fullScript -
Method Detail

isPostgres

public boolean isPostgres()
Returns:
true if postgres

isMysql

public boolean isMysql()
Returns:
true if mysql

isSmallIndexes

public boolean isSmallIndexes()
if small indexes

Returns:
true if small indexes

isOracle

public boolean isOracle()
Returns:
true if postgres

isHsql

public boolean isHsql()
Returns:
true if hsql

isSqlServer

public boolean isSqlServer()
Returns:
true if hsql

appendAdditionalScriptUnique

public void appendAdditionalScriptUnique(String script)
append an additionalScript, but only if it is not already in the body of the script (or additionalScript)

Parameters:
script - should contain script (or scripts), and should end in a semicolon (each line should), and should end in newline

getOldDatabase

public org.apache.ddlutils.model.Database getOldDatabase()
current state of the database (after modifications :) ). Note, this is null if this is working on old db

Returns:
the oldDatabase

setOldDatabase

public void setOldDatabase(org.apache.ddlutils.model.Database oldDatabase)
current state of the database (after modifications :) ). Note, this is null if this is working on old db

Parameters:
oldDatabase - the oldDatabase to set

getDatabase

public org.apache.ddlutils.model.Database getDatabase()
database we are operating on

Returns:
the database

setDatabase

public void setDatabase(org.apache.ddlutils.model.Database database)
database we are operating on

Parameters:
database - the database to set

getAdditionalScripts

public StringBuilder getAdditionalScripts()
additional scripts to add after ddlutils scripts

Returns:
the additionalScripts

setAdditionalScripts

public void setAdditionalScripts(StringBuilder additionalScripts)
additional scripts to add after ddlutils scripts

Parameters:
additionalScripts - the additionalScripts to set

isDestinationVersion

public boolean isDestinationVersion()
Returns:
the isDestinationVersion

setDestinationVersion

public void setDestinationVersion(boolean isDestinationVersion)
Parameters:
isDestinationVersion - the isDestinationVersion to set

getBuildingToVersion

public int getBuildingToVersion()
the eventual version we are build to

Returns:
the buildingToVersion

setBuildingToVersion

public void setBuildingToVersion(int buildingToVersion)
the eventual version we are build to

Parameters:
buildingToVersion - the buildingToVersion to set

getFullScript

public StringBuilder getFullScript()
full script so far (to make sure we dont have duplicate scripts, shouldnt add directly to it from here though

Returns:
the fullScript

setFullScript

public void setFullScript(StringBuilder fullScript)
full script so far (to make sure we dont have duplicate scripts, shouldnt add directly to it from here though

Parameters:
fullScript - the fullScript to set

getPlatform

public org.apache.ddlutils.Platform getPlatform()
ddlutils platform

Returns:
the platform

setPlatform

public void setPlatform(org.apache.ddlutils.Platform platform)
ddlutils platform

Parameters:
platform - the platform to set

getConnection

public Connection getConnection()
jdbc connection

Returns:
the connection

setConnection

public void setConnection(Connection connection)
jdbc connection

Parameters:
connection - the connection to set

getSchema

public String getSchema()
schema

Returns:
the schema

setSchema

public void setSchema(String schema)
schema

Parameters:
schema - the schema to set

getSqlBuilder

public org.apache.ddlutils.platform.SqlBuilder getSqlBuilder()
ddlutils schemabuilder

Returns:
the sqlBuilder

setSqlBuilder

public void setSqlBuilder(org.apache.ddlutils.platform.SqlBuilder sqlBuilder)
ddlutils schemabuilder

Parameters:
sqlBuilder - the sqlBuilder to set

getObjectName

public String getObjectName()
ddl object name (e.g. Grouper or Subject)

Returns:
the objectName

setObjectName

public void setObjectName(String objectName)
ddl object name (e.g. Grouper or Subject)

Parameters:
objectName - the objectName to set