public class CmdSelect extends Cmd
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BRACES |
protected static java.lang.String |
CLOSEBRACES |
protected static java.lang.String |
DELIMITER |
static java.lang.String |
FROM
The keyword for the from clause.
|
protected static java.lang.String |
help |
protected java.lang.String |
lastToken |
protected static java.lang.String |
OPENBRACES |
protected static java.util.HashMap |
operatorInvList |
protected static java.util.HashMap |
operatorList |
protected static java.lang.String |
OPERATORS |
static java.lang.String |
REFTO
The keyword for the refto clause.
|
static java.lang.String |
SELECT
The keyword for the select clause.
|
static java.lang.String[] |
SINGLE_DERVIATION |
protected java.lang.String |
upperToken |
static java.lang.String |
USING
The keyword for the using clause.
|
static java.lang.String |
version |
static java.lang.String |
WHERE
The keyword for the where clause.
|
APPEND_ERR, APPEND_OUT, commandString, counter, fwkCommand, hql, keys, OPEN_ERR, OPEN_OUT, params, result, streamOpened, timeNeededFWKMIMETYPEinfoBusMemberSupportchangeManager, properties, suspendChangeManagersourceauthor, buildnr, className, company, copyright, creationDate, dateFormatString, description, eMail, FWK_ICON, FWK_ICON_ARRAY, FWK_ICON_BG, FWK_ICON_BG_ARRAY, FWK_ICON_BG_LARGE, FWK_ICON_BG_LARGE_ARRAY, FWK_ICON_LARGE, FWK_ICON_LARGE_ARRAY, icon, ICON, iconCount, iconKey, internetAddress, name, titleNameCONTROLLER_PROPERTY, MENU_REASON_CANCELED, MENU_REASON_DESELECTED, MENU_REASON_SELECTEDBUSNAMEINFOBUS_SOURCEAUTHOR, BUILDNR, COMPANY, COPYRIGHT, DATE_FORMAT, DEFAULT_ICON, DESCRIPTION, INTERNET, LARGE_ICON, LARGE_KEY_EXT, LARGE_OPAQUE_ICON, LARGE_OPAQUE_KEY_EXT, OPAQUE_ICON, OPAQUE_KEY_EXT, RCS_DATE_FORMAT, SUPPORT_EMAIL, TITLE_NAME| Constructor and Description |
|---|
CmdSelect()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute()
Execute the select command.
|
protected AIDNameUnitId[] |
getAIDNameUnitId(ApplicationElement[] aeObj,
java.lang.String spec)
Get the AIDNameUnitId structure.
|
protected AIDNameUnitId[] |
getAIDNameUnitId(ApplicationElement[] aeObj,
java.util.Vector colSpec)
Get the AIDNameUnitId structure.
|
protected ApplicationAttribute[] |
getApplicationAttributes(ApplicationElement aeObj,
java.lang.String spec)
Get the application attributes belongs to the given string specification.
|
protected ApplicationElement[] |
getApplicationElements(ApplicationStructure asObj,
java.lang.String spec)
Get the application elements belongs to the given string specification.
|
protected ApplicationRelation[] |
getApplicationRelations(ApplicationElement aeObj,
java.lang.String spec)
Get the application relation belongs to the given string specification.
|
protected ApplicationAttribute[][] |
getAttributes(ApplicationElement[] aeObj,
java.lang.String spec)
Get the application attributes belongs to the given string specification.
|
protected ApplicationAttribute[][] |
getAttributes(InstanceElement[] ieObj,
java.lang.String spec)
Get the application attributes belongs to the given string specification.
|
java.lang.String |
getConditionString(ApplicationStructure asObj,
SelValue selValue)
Get the string presentation of the given condition.
|
protected ElemId[] |
getElemIds(AoSession session,
FwkPropertyGroup map)
Get ids.
|
QueryStructure |
getQueryStructure(AoSession session,
FwkPropertyGroup map)
Get the ods query structure.
|
protected ApplicationRelation[][] |
getRelations(ApplicationElement[] aeObj,
java.lang.String spec)
Get the application relations belongs to the given string specification.
|
protected ApplicationRelation[][] |
getRelations(InstanceElement[] ieObj,
java.lang.String spec)
Get the application relations belong to the given string specification.
|
static ResultColumn[] |
getResultColumns(ElemResultSet[] elemRes)
Get the result columns.
|
OdsxResultSetInterface |
getResultSet()
Get result set.
|
java.lang.String |
getSelectStatement(AoSession session,
QueryStructure query)
Get the select statement for the given query structure.
|
protected SelValue |
getSelValue(ApplicationElement[] aeObj,
java.lang.String field,
java.lang.String op,
java.lang.String val)
Get the SelValue structure.
|
protected java.util.Vector |
getSelValue(ApplicationElement[] aeObj,
java.util.Vector where,
java.util.Vector selVal,
java.util.Vector selOp)
Get the selection value.
|
protected java.lang.String |
getToken(java.util.StringTokenizer st) |
java.lang.String |
getVersion()
Get the version of the HQL implementation.
|
boolean |
handleParsedOperator(java.util.Vector vec,
java.lang.String upperToken)
Handle found operands.
|
FwkPropertyGroup |
parse(java.lang.String statement)
Parse a statement.
|
protected java.lang.String |
parseBraces(java.util.StringTokenizer st)
Parse the string literal.
|
java.util.Vector |
parseConditions(java.util.StringTokenizer st)
Parse the conditions of a where clause.
|
protected void |
parseFrom(java.util.StringTokenizer st,
FwkPropertyGroup map)
Parse the from clause.
|
boolean |
parseParams(java.lang.String params)
Set the parameter string to the command.
|
protected void |
parseRefTo(java.util.StringTokenizer st,
FwkPropertyGroup map)
Parse the refto clause.
|
protected void |
parseSelect(java.util.StringTokenizer st,
FwkPropertyGroup map)
Parse the select clause.
|
protected void |
parseStream(java.util.StringTokenizer st,
java.lang.String key,
FwkPropertyGroup map)
Parse the streaming option.
|
protected java.lang.String |
parseString(java.util.StringTokenizer st)
Parse the string literal.
|
protected void |
parseUsing(java.util.StringTokenizer st,
FwkPropertyGroup map)
Parse the using clause.
|
protected void |
parseWhere(java.util.StringTokenizer st,
FwkPropertyGroup map)
Parse the where clause.
|
addActionListener, addMenuListener, commandString, execute, getActionListenerArray, getButtonClass, getCommandName, getHelpID, getIcon, getIconKey, getMenuEventEnabled, getMenuItemClass, getMenuListenerArray, getMnemonic, getProperties, getProperty, getRadioGroupState, getResult, getSensitivity, getSeparator, getText, getTextKey, getToggle, getToggleState, getToolBarEnabled, getToolTipKey, getToolTipText, getVisibility, hasActionListeners, hasMenuListeners, initializeExecution, isParent, menuSelect, register, registeredObjects, registrySize, release, removeActionListener, removeMenuListener, setAsParent, setButtonClass, setCommandName, setHelpID, setIcon, setIconKey, setInterpreter, setMenuEventEnabled, setMenuItemClass, setMnemonic, setProperty, setRadioGroupState, setSensitivity, setSeparator, setText, setTextKey, setToggle, setToggleState, setToolBarEnabled, setToolTipKey, setToolTipText, setVisibility, terminateExecution, timeNeeded, unregisterdataItemAvailable, dataItemRevoked, finalize, findDataItem, findDataItem, findMultipleDataItems, findMultipleDataItems, getController, initialize, isAssignable, propertyChange, register, setController, setInfoBusName, unregisteraddMimeType, getDataFlavor, getDataFlavors, getMimeTypes, removeMimeTypeaddInfoBusPropertyListener, addInfoBusVetoableListener, getInfoBus, getInfoBusName, getMemberName, isConnected, joinInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus, setMemberName, setNameaddDataItemChangeListener, fireItemAdded, fireItemDeleted, fireItemRevoked, fireItemValueChanged, getName, getPropertyGroup, getSource, isChangeManagerSuspended, removeDataItemChangeListener, setPropertyGroup, suspendChangeManageraddCommand, addCommand, addToGroup, addToGroup, addVetoableChangeListener, addVetoableChangeListener, clearCommands, commandsAvailable, compareTo, deleteGroup, destroyController, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getAuthor, getBuild, getCommand, getCommands, getCommands, getCompany, getCompanyInternetAddress, getCopyright, getCreationDate, getCreationDate, getDateFormatString, getDescription, getFwkMimeTypes, getGroup, getIcon, getIconKey, getPersistentObjectNames, getSupportEMail, getTitle, getTitleName, getVetoableChangeArray, getVetoableChangeListenerArray, getVetoableChangeListenerArray, groupExists, removeCommand, removeFromGroup, removeVetoableChangeListener, removeVetoableChangeListener, setAuthor, setBuild, setCommands, setCompany, setCompanyInternetAddress, setCopyright, setCreationDate, setDateFormatString, setDescription, setDescriptor, setDescriptor, setIcon, setIconKey, setSource, setSupportEMail, setTitleNameaddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, suspendPropertyChangeEventsgetClassName, getPresentationString, getPresentationString, getTransferData, getTransferDataFlavors, isDataFlavorSupported, lostOwnership, setClassName, setCreationDate, toStringgetNiceVersionclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddCommand, addCommand, addToGroup, addToGroup, clearCommands, commandsAvailable, deleteGroup, getCommand, getCommands, getGroup, groupExists, removeCommand, removeFromGroup, setCommandsgetPresentationString, getPresentationStringgetController, setControlleraddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEventsaddMimeType, getDataFlavor, getDataFlavors, getMimeTypes, removeMimeTypegetInfoBusName, getMemberName, isConnected, setMemberNamefireItemAdded, fireItemDeleted, fireItemRevoked, fireItemValueChanged, getPropertyGroup, setPropertyGroup, suspendChangeManagergetCommands, getPersistentObjectNamesdestroyControlleraddVetoableChangeListener, addVetoableChangeListener, getVetoableChangeArray, getVetoableChangeListenerArray, getVetoableChangeListenerArray, removeVetoableChangeListener, removeVetoableChangeListenergetAuthor, getBuild, getClassName, getCompany, getCompanyInternetAddress, getCopyright, getCreationDate, getCreationDate, getDateFormatString, getDescription, getIcon, getIconKey, getName, getPresentationString, getPresentationString, getSupportEMail, getTitle, getTitleName, setAuthor, setBuild, setClassName, setCompany, setCompanyInternetAddress, setCopyright, setCreationDate, setCreationDate, setDateFormatString, setDescription, setDescriptor, setIcon, setIconKey, setName, setSupportEMail, setTitleNamepublic static final java.lang.String version
public static final java.lang.String[] SINGLE_DERVIATION
public static final java.lang.String SELECT
public static final java.lang.String FROM
public static final java.lang.String WHERE
public static final java.lang.String USING
public static final java.lang.String REFTO
protected static final java.lang.String BRACES
protected static final java.lang.String OPENBRACES
protected static final java.lang.String CLOSEBRACES
protected static final java.lang.String OPERATORS
protected static final java.util.HashMap operatorList
protected static final java.util.HashMap operatorInvList
protected static final java.lang.String DELIMITER
protected static java.lang.String help
protected java.lang.String lastToken
protected java.lang.String upperToken
public java.lang.String getVersion()
CmdgetVersion in interface FwkInterfacegetVersion in class Cmdprotected java.lang.String getToken(java.util.StringTokenizer st)
public FwkPropertyGroup parse(java.lang.String statement)
| Prefix | Description |
| BA. | Request a BaseAttribute. |
| BE. | Request a BaseElement. |
| AA. | Request a ApplicationAttribute. |
| AE. | Request a ApplicationElement. |
| Keyword | Datatype | Description |
| SELECT | java.util.Vector | The strings describing the elements to be selected. |
| FROM | java.util.Vector | The strings describing the elements of the from clause. |
| WHERE | java.util.Vector | The strings describing the condition. Each element could be a vector that contains a subcondition. |
Example:
select (BA.Id, Ba.Name)
from (BE.AoTest, AE.Measurement)
where ((BA.id < 10) && (BA.name == SG*));
statement - the statement to be parsed.protected void parseSelect(java.util.StringTokenizer st,
FwkPropertyGroup map)
st - the tokenizer.map - the parser result map.protected void parseFrom(java.util.StringTokenizer st,
FwkPropertyGroup map)
st - the tokenizer.map - the parser result map.protected void parseUsing(java.util.StringTokenizer st,
FwkPropertyGroup map)
st - the tokenizer.map - the parser result map.protected void parseRefTo(java.util.StringTokenizer st,
FwkPropertyGroup map)
st - the tokenizer.map - the parser result map.protected void parseStream(java.util.StringTokenizer st,
java.lang.String key,
FwkPropertyGroup map)
st - the tokenizer.key - the kind of stream.map - the parser result map.protected void parseWhere(java.util.StringTokenizer st,
FwkPropertyGroup map)
st - the tokenizer.map - the parser result map.public java.util.Vector parseConditions(java.util.StringTokenizer st)
st - the tokenizer.protected java.lang.String parseString(java.util.StringTokenizer st)
st - the tokenizer.protected java.lang.String parseBraces(java.util.StringTokenizer st)
st - the tokenizer.public boolean handleParsedOperator(java.util.Vector vec,
java.lang.String upperToken)
vec - the resulting vector.upperToken - the current operand.public QueryStructure getQueryStructure(AoSession session, FwkPropertyGroup map) throws AoException
session - the session to be used for query.map - the result map of the parserAoExceptionAoSessionprotected java.util.Vector getSelValue(ApplicationElement[] aeObj, java.util.Vector where, java.util.Vector selVal, java.util.Vector selOp)
aeObj - An array containing the selected application elements.where - The vector containing the where clause coming from parser.selVal - The vector into the method can save the result. May be nullselOp - The operations of the selection.protected SelValue getSelValue(ApplicationElement[] aeObj, java.lang.String field, java.lang.String op, java.lang.String val)
aeObj - An array containing the application elements.field - The field name or pattern.op - the operation string.val - The value string.protected AIDNameUnitId[] getAIDNameUnitId(ApplicationElement[] aeObj, java.util.Vector colSpec)
aeObj - An array containing the application elements.colSpec - The vector containing the column specification from select statement.protected AIDNameUnitId[] getAIDNameUnitId(ApplicationElement[] aeObj, java.lang.String spec)
aeObj - An array containing the application elements.spec - The column specification from select statement.protected ApplicationAttribute[][] getAttributes(InstanceElement[] ieObj, java.lang.String spec) throws AoException
ieObj - the instance elements.spec - The string specification.AoExceptionprotected ApplicationAttribute[][] getAttributes(ApplicationElement[] aeObj, java.lang.String spec) throws AoException
aeObj - the application elements.spec - The string specification.AoExceptionprotected ApplicationAttribute[] getApplicationAttributes(ApplicationElement aeObj, java.lang.String spec) throws AoException
aeObj - the application element.spec - The string specification.AoExceptionprotected ApplicationRelation[][] getRelations(InstanceElement[] ieObj, java.lang.String spec) throws AoException
ieObj - the instance elements.spec - The string specification.AoExceptionprotected ApplicationRelation[][] getRelations(ApplicationElement[] aeObj, java.lang.String spec) throws AoException
aeObj - the application elements.spec - The string specification.AoExceptionprotected ApplicationRelation[] getApplicationRelations(ApplicationElement aeObj, java.lang.String spec) throws AoException
aeObj - the application element.spec - The string specification.AoExceptionprotected ApplicationElement[] getApplicationElements(ApplicationStructure asObj, java.lang.String spec) throws AoException
asObj - the application structure.spec - The string specification.AoExceptionpublic java.lang.String getSelectStatement(AoSession session, QueryStructure query) throws AoException
session - The session to be used for the select statement.query - The query structure.AoExceptionAoSessionpublic java.lang.String getConditionString(ApplicationStructure asObj, SelValue selValue)
public static ResultColumn[] getResultColumns(ElemResultSet[] elemRes)
elemRes - The result set of the queryElemResultSetpublic boolean parseParams(java.lang.String params)
parseParams in interface CommandInterfaceparseParams in class Cmdparams - the param string to be parsed.public OdsxResultSetInterface getResultSet()
public boolean execute()
execute in interface CommandInterfaceexecute in class Cmdprotected ElemId[] getElemIds(AoSession session, FwkPropertyGroup map) throws AoException
AoException