org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.routineeditor
Class RoutineSourceUpdater

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sql.updater.ProceduralObjectSourceUpdater
      extended by org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.routineeditor.RoutineSourceUpdater
All Implemented Interfaces:
ISybaseDdlConstants, IGenericDdlConstants
Direct Known Subclasses:
ASARoutineSourceUpdater

public class RoutineSourceUpdater
extends ProceduralObjectSourceUpdater
implements ISybaseDdlConstants, IGenericDdlConstants

Author:
Hui Cao

Field Summary
static java.lang.String RECOMPILE
           
 
Fields inherited from interface org.eclipse.datatools.enablement.sybase.ddl.ISybaseDdlConstants
ALTER_PRIVILEGE, ASC, AT, BEGIN, CAST, CHECKOPTION, CLUSTERED, COLUMN, COMMENT, COMMIT, DATABASE, DELETE_PRIVILEGE, DESC, END, END_IF, EQUAL, EVENT, EXEC_PRIVILEGE, EXISTS, EXTERNAL, EXTERNAL_NAME, FILE, FROM, GO, GO_FOR, GRANT, IF, IN, INOUT, INSERT_PRIVILEGE, IS, JAVA, LOCATOR, LOG, MESSAGE, NONCLUSTERED, OUT, OUTPUT, REFERENCE_PRIVILEGE, REFERENCES_PRIVILEGE, REMOVE, RENAME, REVOKE, SELECT_PRIVILEGE, SEMICOLUMN, SP_RENAME, THEN, TO, UPDATE_PRIVILEGE, WITH_GRANT_OPTION, WITH_RECOMPILE
 
Fields inherited from interface org.eclipse.datatools.enablement.sybase.IGenericDdlConstants
ADD, AFTER, ALIAS, ALTER, AS, BEFORE, BLOB, CASCADE, CASCADED, CHECK, CLOB, COMMA, COMPARISONS, CONSTRAINT, CREATE, DATALINK, DBCLOB, DEFAULT, DEFERRABLE, DEFERRED, DELETE, DOT, DOUBLE_QUOTE, DROP, EACH, EMPTY_STRING, FOR, FOREIGN_KEY, FUNCTION, INDEX, INITIALLY, INSERT, INSTEAD_OF, LEFT_PARENTHESIS, LOCAL, LONG, MODIFY, NEW, NEW_TABLE, NEWLINE, NO, NOT, NULL, OF, OLD, OLD_TABLE, ON, OPTION, PRIMARY_KEY, PROCEDURE, REFERENCES, REFERENCING, RENAME, RESTRICT, RIGHT_PARENTHESIS, ROW, SET, SINGLE_QUOTE, SPACE, STATEMENT, TAB, TABLE, TRIGGER, TYPE, UNIQUE, UPDATE, VARCHAR, VARGRAPHIC, VIEW, WHEN, WITH
 
Constructor Summary
RoutineSourceUpdater(SybaseRoutine _object, DatabaseDefinition dbDefinition)
           
 
Method Summary
 java.lang.String getBody()
           
 void setBody(java.lang.String body)
           
 boolean updateParameterAdded(SybaseParameter param, java.lang.String paramDef, int index)
          Updates the source by adding the parameter declaration at the specified index.
 boolean updateParameterDeleted(int index)
           
 boolean updateParameterModified(SybaseParameter param, java.lang.String paramDef, int index)
          Updates the source by modifying the parameter declaration at the specified index.
 boolean updateParameterRearranged(int index)
          Updates the source when parameter at index and index + 1 are switched.
 
Methods inherited from class org.eclipse.datatools.sqltools.sql.updater.ProceduralObjectSourceUpdater
getTestMode, setTestMode, updateName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECOMPILE

public static java.lang.String RECOMPILE
Constructor Detail

RoutineSourceUpdater

public RoutineSourceUpdater(SybaseRoutine _object,
                            DatabaseDefinition dbDefinition)
Method Detail

updateParameterAdded

public boolean updateParameterAdded(SybaseParameter param,
                                    java.lang.String paramDef,
                                    int index)
Updates the source by adding the parameter declaration at the specified index. This index might be different with the index in Routines.getParameters() list because there might be invalid entries in the list.

Parameters:
param -
index - parameter index in the source
Returns:

updateParameterModified

public boolean updateParameterModified(SybaseParameter param,
                                       java.lang.String paramDef,
                                       int index)
Updates the source by modifying the parameter declaration at the specified index. This index might be different with the index in Routines.getParameters() list because there might be invalid entries in the list.

Parameters:
param -
index - parameter index in the source
Returns:

updateParameterDeleted

public boolean updateParameterDeleted(int index)
Parameters:
index - parameter index in the source
Returns:

updateParameterRearranged

public boolean updateParameterRearranged(int index)
Updates the source when parameter at index and index + 1 are switched.

Parameters:
index - parameter index in the source

getBody

public java.lang.String getBody()
Specified by:
getBody in class ProceduralObjectSourceUpdater

setBody

public void setBody(java.lang.String body)
Specified by:
setBody in class ProceduralObjectSourceUpdater