Package gudusoft.gsqlparser.resolver2
Class NameResolver
Object
gudusoft.gsqlparser.resolver2.NameResolver
Core component for resolving column references to their sources.
Key responsibilities:
1. Resolve TObjectName (column references) using scope tree
2. Handle qualified and unqualified names
3. Detect and report ambiguities
4. Apply GUESS_COLUMN_STRATEGY for ambiguous columns
5. Update TObjectName with resolution results
6. Update ResolutionContext for global querying
-
Constructor Summary
ConstructorsConstructorDescriptionNameResolver(INameMatcher nameMatcher, ResolutionContext context) Deprecated.Use NameResolver(TSQLResolverConfig, ResolutionContext) insteadNameResolver(TSQLResolverConfig config, ResolutionContext context) Create a NameResolver with full configuration. -
Method Summary
Modifier and TypeMethodDescriptionfindNamespacesWithColumn(String columnName, IScope scope) Find all namespaces that contain a given column.resolve(TObjectName objName, IScope scope) Resolve a column reference (TObjectName) within a given scope.resolveInNamespace(String columnName, INamespace namespace) Resolve a column within a specific namespace (for direct lookups).
-
Constructor Details
-
NameResolver
Create a NameResolver with full configuration.- Parameters:
config- The resolver configuration (includes name matcher and strategy)context- The resolution context for tracking results
-
NameResolver
Deprecated.Use NameResolver(TSQLResolverConfig, ResolutionContext) insteadCreate a NameResolver with just name matcher (backward compatibility). Uses default configuration for GUESS_COLUMN_STRATEGY.
-
-
Method Details
-
resolve
Resolve a column reference (TObjectName) within a given scope.- Parameters:
objName- The column reference to resolvescope- The scope where the reference appears- Returns:
- Resolution result
-
resolveInNamespace
Resolve a column within a specific namespace (for direct lookups). -
findNamespacesWithColumn
Find all namespaces that contain a given column. Used for implementing full candidate collection in ambiguous scenarios. -
getNameMatcher
-
getContext
-