org.eclipse.datatools.sqltools.schemaobjecteditor.model
Interface ISchemaObjectEditModel

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
All Known Implementing Classes:
AbstractSchemaObjectEditModel, ASATableSchemaEditModel, ASAUserDefinedTypeObjectEditModel, ProceduralObjectEditModel

public interface ISchemaObjectEditModel
extends org.eclipse.core.runtime.IAdaptable

The schema object edit model is defined for schema object editor, as part of editor input, this model provides data to the schema object editor, modifications are also stored in this model as well.
The underlying SQL model object in this model is a cloned one from SchemaObjectImmutableModel

The initial status of the underlying SQL model object is kept in the ISchemaObjectImmutableModel, which is the real SQL model object in the big SQL model instances map.

Author:
Idull

Field Summary
static int ERROR_REFRESH_ADDITIONAL_OBJ
           
static int FATAL_ERROR_MAIN_OBJ_LOST
           
static int REFRESH_SUCCESSFUL
           
 
Method Summary
 boolean checkModelExistence()
          Check model existence
 java.util.Map getAdditionalSQLObjects()
          Returns the additional SQL objects, the items defined here should has an onte-to-one relationship with those additional SQL objects defined in ISchemaObjectImmutableModel
 org.eclipse.emf.ecore.util.EcoreUtil.Copier getCopier()
          Returns the copier
 java.lang.String getDeltaDDL()
          Returns the delta ddl which will be used to execute
 java.lang.String getEditorTooltipText()
          Returns the tooltip text for the editor in which this edit model is being edited
 SQLObject getMainSQLObject()
          Returns the underlying SQL object
 ISchemaObjectImmutableModel getSchemaObjectImmutableModel()
          Returns the immutable model of this edit model
 int refreshFromDB()
          Refreshes the edit model to make it sychronize with DB, this will be delegated to the immutable model to refresh
 void revert()
          Reverts the edit model using the immutable model
 void startLogging()
          Starts logging, this can be manually called when the editing is started.
 void stopLogging()
          Stops logging, this should be manually called when the editing is finished
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

REFRESH_SUCCESSFUL

static final int REFRESH_SUCCESSFUL
See Also:
Constant Field Values

FATAL_ERROR_MAIN_OBJ_LOST

static final int FATAL_ERROR_MAIN_OBJ_LOST
See Also:
Constant Field Values

ERROR_REFRESH_ADDITIONAL_OBJ

static final int ERROR_REFRESH_ADDITIONAL_OBJ
See Also:
Constant Field Values
Method Detail

revert

void revert()
Reverts the edit model using the immutable model


getSchemaObjectImmutableModel

ISchemaObjectImmutableModel getSchemaObjectImmutableModel()
Returns the immutable model of this edit model

Returns:

refreshFromDB

int refreshFromDB()
Refreshes the edit model to make it sychronize with DB, this will be delegated to the immutable model to refresh

Returns:
0 if successfully refresh, returns error code otherwise
See Also:
FATAL_ERROR_MAIN_OBJ_LOST, ERROR_REFRESH_ADDITIONAL_OBJ

getMainSQLObject

SQLObject getMainSQLObject()
Returns the underlying SQL object

Returns:

getAdditionalSQLObjects

java.util.Map getAdditionalSQLObjects()
Returns the additional SQL objects, the items defined here should has an onte-to-one relationship with those additional SQL objects defined in ISchemaObjectImmutableModel

Returns:

getCopier

org.eclipse.emf.ecore.util.EcoreUtil.Copier getCopier()
Returns the copier

Returns:

getDeltaDDL

java.lang.String getDeltaDDL()
Returns the delta ddl which will be used to execute

Returns:

startLogging

void startLogging()
Starts logging, this can be manually called when the editing is started. And it is called after the model is cloned.


stopLogging

void stopLogging()
Stops logging, this should be manually called when the editing is finished


getEditorTooltipText

java.lang.String getEditorTooltipText()
Returns the tooltip text for the editor in which this edit model is being edited

Returns:

checkModelExistence

boolean checkModelExistence()
Check model existence