Class DeleteScope
Object
gudusoft.gsqlparser.resolver2.scope.AbstractScope
gudusoft.gsqlparser.resolver2.scope.DeleteScope
- All Implemented Interfaces:
IScope
Scope for DELETE statement.
Contains:
- Target table (the DELETE table)
- FROM clause scope (optional - for DELETE...FROM syntax in SQL Server)
- WHERE clause scope
Example (SQL Server):
DELETE FROM Sales.SalesPersonQuotaHistory
FROM Sales.SalesPersonQuotaHistory AS spqh
INNER JOIN Sales.SalesPerson AS sp
ON spqh.SalesPersonID = sp.SalesPersonID
WHERE sp.SalesYTD > 2500000.00;
Resolution strategy:
- WHERE clause columns resolve from all visible tables (target table + FROM clause tables)
- JOIN ON clause columns resolve from the joined tables
-
Field Summary
Fields inherited from class gudusoft.gsqlparser.resolver2.scope.AbstractScope
node, parent, scopeType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefault implementation: delegate to parentvoidresolve(List<String> names, INameMatcher matcher, boolean deep, IResolved resolved) Resolve a name within this DELETE scope.resolveTable(String tableName) Default implementation: delegate to parentvoidsetFromScope(FromScope fromScope) voidsetWhereScope(IScope whereScope) toString()Methods inherited from class gudusoft.gsqlparser.resolver2.scope.AbstractScope
addChild, fullyQualify, getChildren, getNode, getParent, getScopeType, isWithin
-
Constructor Details
-
DeleteScope
-
-
Method Details
-
setFromScope
-
getFromScope
-
setWhereScope
-
getWhereScope
-
getDeleteStatement
-
resolveTable
Description copied from class:AbstractScopeDefault implementation: delegate to parent- Specified by:
resolveTablein interfaceIScope- Overrides:
resolveTablein classAbstractScope- Parameters:
tableName- Table name or alias- Returns:
- Namespace if found, null otherwise
-
getVisibleNamespaces
Description copied from class:AbstractScopeDefault implementation: delegate to parent- Specified by:
getVisibleNamespacesin interfaceIScope- Overrides:
getVisibleNamespacesin classAbstractScope- Returns:
- List of visible namespaces
-
resolve
Resolve a name within this DELETE scope. Resolution strategy (same as UpdateScope): 1. For qualified names (t.col): find table t in FROM scope, then resolve col 2. For unqualified names (col): search all visible namespaces in FROM scope 3. Delegate to parent for names not found locally- Specified by:
resolvein interfaceIScope- Overrides:
resolvein classAbstractScope- Parameters:
names- Name parts (e.g., ["schema", "table", "column"])matcher- Name matcher for case sensitivity rulesdeep- Whether to recursively resolve into record fieldsresolved- Callback to collect all matches
-
toString
- Overrides:
toStringin classAbstractScope
-