Package gudusoft.gsqlparser
Enum EResolverType
- All Implemented Interfaces:
Serializable,Comparable<EResolverType>,java.lang.constant.Constable
Specifies which SQL resolver to use for name resolution during parsing.
The resolver is responsible for linking column references to their source tables and performing semantic analysis after parsing.
Usage Example:
TGSqlParser parser = new TGSqlParser(EDbVendor.dbvoracle); parser.setResolverType(EResolverType.RESOLVER2); // Use new resolver parser.sqltext = "SELECT * FROM employees"; parser.parse(); // Access resolver2 results TSQLResolver2 resolver = parser.getResolver2();
Precedence:
Instance-level setting (setResolverType) takes precedence over global TBaseType settings. When set to DEFAULT, the behavior is determined by TBaseType.isEnableResolver() and TBaseType.isEnableResolver2().
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic EResolverTypeReturns the enum constant of this type with the specified name.static EResolverType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Use global TBaseType settings to determine which resolver to use. This is the default behavior for backward compatibility.Resolution order:
- If TBaseType.isEnableResolver2() is true, use RESOLVER2
- Else if TBaseType.isEnableResolver() is true, use RESOLVER
- Else use NONE (no resolution)
-
RESOLVER
Use the original TSQLResolver for name resolution. This is the legacy resolver that has been available since early versions. -
RESOLVER2
Use the new TSQLResolver2 for name resolution.TSQLResolver2 provides improved column-to-table resolution with:
- Clear scope-based name resolution
- Full candidate collection for ambiguous cases
- Confidence-scored inference
- Better tracing and debugging
- CTE and subquery support
After parsing, access the resolver via
TGSqlParser.getResolver2(). -
NONE
Disable name resolution entirely. Only parsing will be performed, no semantic analysis.Use this when you only need the AST structure and don't need column-to-table relationships resolved.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-