net.sf.farrago.ddl
Class DdlStmt

java.lang.Object
  extended by net.sf.farrago.ddl.DdlStmt
All Implemented Interfaces:
FarragoSessionDdlStmt
Direct Known Subclasses:
DdlAlterStmt, DdlAnalyzeStmt, DdlCheckpointStmt, DdlCreateStmt, DdlDeallocateOldStmt, DdlDropStmt, DdlExtendCatalogStmt, DdlGrantStmt, DdlImportForeignSchemaStmt, DdlReloadTableStmt, DdlReplaceCatalogStmt, DdlSetContextStmt, DdlSetParamStmt, DdlSetSessionImplementationStmt, DdlSetSessionParamStmt, DdlTruncateStmt, DdlTxnStmt

public abstract class DdlStmt
extends Object
implements FarragoSessionDdlStmt

DdlStmt represents the output of DDL statement parsing. Most DDL statements update the catalog directly as they are parsed. DdlStmt does not duplicate the information written to the catalog; it only references and annotates it.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/ddl/DdlStmt.java#19 $
Author:
John V. Sichi

Field Summary
private  CwmModelElement modelElement
           
private  boolean runsAsDml
          True if the DDL statement is treated as a DML statement with respect to how locking behaves
 
Constructor Summary
protected DdlStmt(CwmModelElement modelElement)
           
protected DdlStmt(CwmModelElement modelElement, boolean runsAsDml)
           
 
Method Summary
 CwmModelElement getModelElement()
           
 boolean isDropRestricted()
           
 void postCommit(FarragoSessionDdlValidator ddlValidator)
          Called after execution, after committing the repository transaction.
 void postExecute()
          Called immediately after generic execution.
 void preExecute()
          Called before generic execution.
 void preValidate(FarragoSessionDdlValidator ddlValidator)
          Called before generic validation.
 boolean requiresCommit()
           
 boolean runsAsDml()
           
abstract  void visit(DdlVisitor visitor)
          Invokes a visitor on this statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelElement

private final CwmModelElement modelElement

runsAsDml

private final boolean runsAsDml
True if the DDL statement is treated as a DML statement with respect to how locking behaves

Constructor Detail

DdlStmt

protected DdlStmt(CwmModelElement modelElement)

DdlStmt

protected DdlStmt(CwmModelElement modelElement,
                  boolean runsAsDml)
Method Detail

getModelElement

public CwmModelElement getModelElement()
Specified by:
getModelElement in interface FarragoSessionDdlStmt
Returns:
the top-level CwmModelElement affected by this stmt, or null if none

isDropRestricted

public boolean isDropRestricted()
Specified by:
isDropRestricted in interface FarragoSessionDdlStmt
Returns:
whether DROP RESTRICT is in effect

preValidate

public void preValidate(FarragoSessionDdlValidator ddlValidator)
Description copied from interface: FarragoSessionDdlStmt
Called before generic validation.

Specified by:
preValidate in interface FarragoSessionDdlStmt
Parameters:
ddlValidator - the object validating this stmt

preExecute

public void preExecute()
Description copied from interface: FarragoSessionDdlStmt
Called before generic execution.

Specified by:
preExecute in interface FarragoSessionDdlStmt

postExecute

public void postExecute()
Description copied from interface: FarragoSessionDdlStmt
Called immediately after generic execution.

Specified by:
postExecute in interface FarragoSessionDdlStmt

postCommit

public void postCommit(FarragoSessionDdlValidator ddlValidator)
Description copied from interface: FarragoSessionDdlStmt
Called after execution, after committing the repository transaction.

Specified by:
postCommit in interface FarragoSessionDdlStmt
Parameters:
ddlValidator - the object validating this stmt

requiresCommit

public boolean requiresCommit()
Specified by:
requiresCommit in interface FarragoSessionDdlStmt
Returns:
true if this statement implies an auto-commit before and after

runsAsDml

public boolean runsAsDml()
Specified by:
runsAsDml in interface FarragoSessionDdlStmt
Returns:
true if this DDL statement should be treated like a DML statement with respect to locking

visit

public abstract void visit(DdlVisitor visitor)
Invokes a visitor on this statement.

Parameters:
visitor - DdlVisitor to invoke