Package org.teiid.query.sql.lang
Class Delete
- java.lang.Object
-
- org.teiid.query.sql.lang.Command
-
- org.teiid.query.sql.lang.ProcedureContainer
-
- org.teiid.query.sql.lang.Delete
-
- All Implemented Interfaces:
Cloneable,FilteredCommand,TargetedCommand,LanguageObject
public class Delete extends ProcedureContainer implements FilteredCommand
This class represents a SQL Delete statement of the form: "DELETE FROM <group> [WHERE <criteria>]". Implements Command interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Field Summary
-
Fields inherited from class org.teiid.query.sql.lang.Command
tempGroupIDs, TYPE_ALTER_PROC, TYPE_ALTER_TRIGGER, TYPE_ALTER_VIEW, TYPE_BATCHED_UPDATE, TYPE_CREATE, TYPE_DELETE, TYPE_DROP, TYPE_DYNAMIC, TYPE_EXPLAIN, TYPE_INSERT, TYPE_QUERY, TYPE_SOURCE_EVENT, TYPE_STORED_PROCEDURE, TYPE_TRIGGER_ACTION, TYPE_UNKNOWN, TYPE_UPDATE, TYPE_UPDATE_PROCEDURE
-
-
Constructor Summary
Constructors Constructor Description Delete()Constructs a default instance of this class.Delete(GroupSymbol group)Constructs an instance of this class given the group.Delete(GroupSymbol group, Criteria criteria)Constructs an instance of this class given the group and criteria.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptVisitor(LanguageVisitor visitor)Method for accepting a visitor.booleanareResultsCachable()Whether the results are cachable.Objectclone()Return a copy of this Delete.booleanequals(Object obj)Compare two commands for equality.CriteriagetCriteria()Returns the criteria object for this command.GroupSymbolgetGroup()Returns the group being deleted fromListgetProjectedSymbols()Get the ordered list of all elements returned by this query.intgetType()Return type of command.inthashCode()Get hashcode for command.voidsetCriteria(Criteria criteria)Set the criteria for this Delete commandvoidsetGroup(GroupSymbol group)Set the group for this Delete commandStringtoString()Returns a string representation of an instance of this class.-
Methods inherited from class org.teiid.query.sql.lang.ProcedureContainer
addTag, copyMetadataState, getUpdateCount, getUpdateInfo, hasTag, setUpdateCount, setUpdateInfo
-
Methods inherited from class org.teiid.query.sql.lang.Command
addExternalGroupToContext, copyMetadataState, getActualCommand, getAllExternalGroups, getCacheHint, getCommandToken, getCorrelatedReferences, getExternalGroupContexts, getOption, getProcessorPlan, getResultSetColumns, getSourceHint, getTemporaryMetadata, getUpdateCommandSymbol, printCommandTree, printCommandTree, pushNewResolvingContext, returnsResultSet, sameOptionAndHint, setCacheHint, setCorrelatedReferences, setExternalGroupContexts, setOption, setProcessorPlan, setSourceHint, setTemporaryMetadata
-
-
-
-
Constructor Detail
-
Delete
public Delete()
Constructs a default instance of this class.
-
Delete
public Delete(GroupSymbol group)
Constructs an instance of this class given the group.- Parameters:
group- Identifier of the group to delete data from.
-
Delete
public Delete(GroupSymbol group, Criteria criteria)
Constructs an instance of this class given the group and criteria.- Parameters:
group- Identifier of the group to delete data from.criteria- The criteria specifying constraints on what data will be deleted.
-
-
Method Detail
-
getType
public int getType()
Return type of command.- Specified by:
getTypein classCommand- Returns:
Command.TYPE_DELETE
-
getGroup
public GroupSymbol getGroup()
Returns the group being deleted from- Specified by:
getGroupin interfaceTargetedCommand- Returns:
- Group symbol
-
setGroup
public void setGroup(GroupSymbol group)
Set the group for this Delete command- Parameters:
group- Group to be associated with this command
-
getCriteria
public Criteria getCriteria()
Returns the criteria object for this command.- Specified by:
getCriteriain interfaceFilteredCommand- Returns:
- criteria
-
setCriteria
public void setCriteria(Criteria criteria)
Set the criteria for this Delete command- Specified by:
setCriteriain interfaceFilteredCommand- Parameters:
criteria- Criteria to be associated with this command
-
acceptVisitor
public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface:LanguageObjectMethod for accepting a visitor. It is the responsibility of the language object to call back on the visitor.- Specified by:
acceptVisitorin interfaceLanguageObject- Parameters:
visitor- Visitor being used
-
hashCode
public int hashCode()
Get hashcode for command. WARNING: This hash code relies on the hash codes of the Group and Criteria clause. If the command changes, it's hash code will change and it can be lost from collections. Hash code is only valid after the command has been completely constructed.
-
toString
public String toString()
Returns a string representation of an instance of this class.
-
equals
public boolean equals(Object obj)
Compare two commands for equality. Will only evaluate to equal if they are IDENTICAL: group is the same, criteria are in the same exact structure.
-
clone
public Object clone()
Return a copy of this Delete.- Specified by:
clonein interfaceLanguageObject- Specified by:
clonein classCommand- Returns:
- Deep clone of this object
-
getProjectedSymbols
public List getProjectedSymbols()
Get the ordered list of all elements returned by this query. These elements may be ElementSymbols or ExpressionSymbols but in all cases each represents a single column.- Specified by:
getProjectedSymbolsin classCommand- Returns:
- Ordered list of SingleElementSymbol
-
areResultsCachable
public boolean areResultsCachable()
Description copied from class:CommandWhether the results are cachable.- Specified by:
areResultsCachablein classCommand- Returns:
- True if the results are cachable; false otherwise.
- See Also:
Command.areResultsCachable()
-
-