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 void
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.boolean
areResultsCachable()
Whether the results are cachable.Object
clone()
Return a copy of this Delete.boolean
equals(Object obj)
Compare two commands for equality.Criteria
getCriteria()
Returns the criteria object for this command.GroupSymbol
getGroup()
Returns the group being deleted fromList
getProjectedSymbols()
Get the ordered list of all elements returned by this query.int
getType()
Return type of command.int
hashCode()
Get hashcode for command.void
setCriteria(Criteria criteria)
Set the criteria for this Delete commandvoid
setGroup(GroupSymbol group)
Set the group for this Delete commandString
toString()
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:
getType
in classCommand
- Returns:
Command.TYPE_DELETE
-
getGroup
public GroupSymbol getGroup()
Returns the group being deleted from- Specified by:
getGroup
in 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:
getCriteria
in interfaceFilteredCommand
- Returns:
- criteria
-
setCriteria
public void setCriteria(Criteria criteria)
Set the criteria for this Delete command- Specified by:
setCriteria
in interfaceFilteredCommand
- Parameters:
criteria
- Criteria to be associated with this command
-
acceptVisitor
public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface:LanguageObject
Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.- Specified by:
acceptVisitor
in 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:
clone
in interfaceLanguageObject
- Specified by:
clone
in 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:
getProjectedSymbols
in classCommand
- Returns:
- Ordered list of SingleElementSymbol
-
areResultsCachable
public boolean areResultsCachable()
Description copied from class:Command
Whether the results are cachable.- Specified by:
areResultsCachable
in classCommand
- Returns:
- True if the results are cachable; false otherwise.
- See Also:
Command.areResultsCachable()
-
-