ThinkUI SQL Client 1.1.3 API

thinkui.sqlclient
Class AbstractSQLClientCommand

java.lang.Object
  extended bythinkui.db.AbstractDataObject
      extended bythinkui.command.AbstractCommand
          extended bythinkui.desktop.AbstractSwingCommand
              extended bythinkui.sqlclient.AbstractSQLClientCommand
All Implemented Interfaces:
thinkui.common.Abortable, thinkui.common.CaptionSupport, thinkui.common.ClassNameSupport, java.lang.Cloneable, thinkui.command.Command, thinkui.command.CommandErrorHandler, java.lang.Comparable, thinkui.db.DataClassSupport, DataObject, java.io.Serializable
Direct Known Subclasses:
AbstractGenerateCommand, GenerateTableDataCommand, ImportSQLQueryCommand, LoadDataFileCommand, ViewDataObjectEditorCommand, ViewSQLQueryCommand

public abstract class AbstractSQLClientCommand
extends thinkui.desktop.AbstractSwingCommand
implements thinkui.command.CommandErrorHandler

Abstract command for all SQL Client commands.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class thinkui.desktop.AbstractSwingCommand
DATA_CLASS
 
Fields inherited from interface thinkui.command.Command
NO_RESULT
 
Fields inherited from interface thinkui.db.DataObject
INDEX_SEPARATOR, NAME_SEPARATOR
 
Constructor Summary
AbstractSQLClientCommand(java.lang.String label)
          AbstractSQLClientCommand constructor.
 
Method Summary
static boolean canTranslateToDataClass(java.lang.Object object)
          Helper method to check if the given object can be translated the given object to a DataClass.
static boolean canTranslateToTableData(java.lang.Object object)
          Helper method to check if the given object can be translated the given object to a TableData.
static java.util.List filterDataObjects(thinkui.desktop.SwingCommandContext ctx, java.util.List dataObjects)
          Helper method to filter the list of data objects based on the configured DataObjectFilter (if any) appropriate for the given list.
static thinkui.db.jdbc.JDBCDataObjectManager getDataObjectManager(thinkui.desktop.SwingCommandContext ctx)
          Look for a data object manager configured in the given swing command context and return it.
static thinkui.db.jdbc.JDBCMetaDataManager getMetaDataManager(thinkui.desktop.SwingCommandContext ctx)
          Look for a meta data manager configured in the given swing command context and return it.
 boolean handleError(thinkui.command.CommandContext commandContext, thinkui.command.Command cmd, java.lang.Throwable t)
          Handle an error encountered when executing the given command.
 boolean isUseApplicationDataObjectManager()
          Whether or not to use the application data object manager.
 void postExecute(thinkui.command.CommandContext commandContext)
          Perform any required work after the execute() method is called.
 void preExecute(thinkui.command.CommandContext commandContext)
          Perform any required work before the execute() method is called.
 AbstractSQLClientCommand setUseApplicationDataObjectManager(boolean useApplicationDataObjectManager)
          Sets whether or not to use the application data object manager.
static DataClass translateToDataClass(java.lang.Object object)
          Helper method to translate the given object to a DataClass or null.
static TableData translateToTableData(thinkui.db.metadata.ColumnData columnData)
          Helper method to translate a Column Data to a TableData.
static TableData translateToTableData(DataClass dataClass)
          Helper method to translate a Data Class to a TableData.
static TableData translateToTableData(java.lang.Object object)
          Helper method to translate the given object to a TableData or null.
static TableData translateToTableData(Relationship relationship)
          Helper method to translate a relationship "To" Data Class to a TableData.
 
Methods inherited from class thinkui.desktop.AbstractSwingCommand
getCommandManager, getDataClass, getLabel, getSelectedObject, getSelectedObjects, setCommandManager, setLabel
 
Methods inherited from class thinkui.command.AbstractCommand
abort, equals, getData, getExecutionState, getInitCommand, getNextCommand, getObjectClassName, isAbortable, isAbortRequested, isEnabled, isPrecondition, setAbortRequested, setData, setEnabled, setExecutionState, setInitCommand, setNextCommand
 
Methods inherited from class thinkui.db.AbstractDataObject
clearValue, clearValues, compareTo, copy, copyFrom, copyFrom, copyFrom, copyNonEmptyValuesFrom, getAsString, getAttribute, getBigDecimal, getBigInteger, getBoolean, getCaption, getCharacter, getDate, getInteger, getLong, getModifiedAttrNames, getName, getNumber, getPersistentState, getPrimaryKey, getShort, getString, getTimestamp, getValue, getValuesMap, hashCode, initFrom, initFrom, initFrom, initValue, isAttribute, isModified, isModified, isNew, isOverridden, isReadOnly, isReadOnly, isValueEmpty, isValueSet, override, setModifiedAttrNames, setName, setPersistentState, setReadOnly, setValue, setValuesMap, toString, validate
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface thinkui.command.Command
execute
 
Methods inherited from interface thinkui.db.DataObject
clearValue, clearValues, copy, copyFrom, copyFrom, copyFrom, getAsString, getAttribute, getBigDecimal, getBigInteger, getBoolean, getCharacter, getDate, getInteger, getLong, getModifiedAttrNames, getName, getPersistentState, getPrimaryKey, getShort, getString, getTimestamp, getValue, getValuesMap, hashCode, initFrom, initFrom, initFrom, initValue, isAttribute, isModified, isModified, isNew, isOverridden, isReadOnly, isReadOnly, isValueEmpty, isValueSet, override, setModifiedAttrNames, setName, setPersistentState, setReadOnly, setValue, setValuesMap, toString, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface thinkui.common.CaptionSupport
getCaption
 

Constructor Detail

AbstractSQLClientCommand

public AbstractSQLClientCommand(java.lang.String label)
AbstractSQLClientCommand constructor.

Method Detail

canTranslateToDataClass

public static final boolean canTranslateToDataClass(java.lang.Object object)
Helper method to check if the given object can be translated the given object to a DataClass.


canTranslateToTableData

public static final boolean canTranslateToTableData(java.lang.Object object)
Helper method to check if the given object can be translated the given object to a TableData.


filterDataObjects

public static final java.util.List filterDataObjects(thinkui.desktop.SwingCommandContext ctx,
                                                     java.util.List dataObjects)
Helper method to filter the list of data objects based on the configured DataObjectFilter (if any) appropriate for the given list.

Returns:
the filtered list or the unmodified list if not filter was found.

getDataObjectManager

public static final thinkui.db.jdbc.JDBCDataObjectManager getDataObjectManager(thinkui.desktop.SwingCommandContext ctx)
                                                                        throws java.lang.Exception
Look for a data object manager configured in the given swing command context and return it. If no data data object manager has been configured, return the application data object manager. If the connection is closed, it will be automatically reconnected.

Returns:
the data object manager configured in the given swing command context.
Throws:
java.lang.Exception

getMetaDataManager

public static final thinkui.db.jdbc.JDBCMetaDataManager getMetaDataManager(thinkui.desktop.SwingCommandContext ctx)
                                                                    throws java.lang.Exception
Look for a meta data manager configured in the given swing command context and return it. If no meta data manager has been configured, return the application meta data manager. If the connection is closed, it will be automatically reconnected.

Returns:
the meta data manager configured in the given swing command context.
Throws:
java.lang.Exception

handleError

public boolean handleError(thinkui.command.CommandContext commandContext,
                           thinkui.command.Command cmd,
                           java.lang.Throwable t)
Handle an error encountered when executing the given command.

Specified by:
handleError in interface thinkui.command.CommandErrorHandler
Returns:
whether or not the error was handled.

isUseApplicationDataObjectManager

public final boolean isUseApplicationDataObjectManager()
Whether or not to use the application data object manager. If false, the getDataObjectManager() method is used to get the data object manager configured in the command context.

Returns:
whether or not to use the application data object manager.

postExecute

public void postExecute(thinkui.command.CommandContext commandContext)
                 throws java.lang.Exception
Perform any required work after the execute() method is called.

Specified by:
postExecute in interface thinkui.command.Command
Throws:
java.lang.Exception

preExecute

public void preExecute(thinkui.command.CommandContext commandContext)
                throws java.lang.Exception
Perform any required work before the execute() method is called.

Specified by:
preExecute in interface thinkui.command.Command
Throws:
java.lang.Exception

setUseApplicationDataObjectManager

public final AbstractSQLClientCommand setUseApplicationDataObjectManager(boolean useApplicationDataObjectManager)
Sets whether or not to use the application data object manager. If the flag is true, the SQLClient.getApplicationDataObjectManager(ctx) is used to find the application data object manager. Otherwise, the getDataObjectManager() method is used to get the data object manager configured in the command context.


translateToDataClass

public static final DataClass translateToDataClass(java.lang.Object object)
Helper method to translate the given object to a DataClass or null.


translateToTableData

public static final TableData translateToTableData(thinkui.db.metadata.ColumnData columnData)
Helper method to translate a Column Data to a TableData.


translateToTableData

public static final TableData translateToTableData(DataClass dataClass)
Helper method to translate a Data Class to a TableData.


translateToTableData

public static final TableData translateToTableData(java.lang.Object object)
Helper method to translate the given object to a TableData or null.


translateToTableData

public static final TableData translateToTableData(Relationship relationship)
Helper method to translate a relationship "To" Data Class to a TableData.


ThinkUI SQL Client 1.1.3 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.