Enum EResolverType

Object
Enum<EResolverType>
gudusoft.gsqlparser.EResolverType
All Implemented Interfaces:
Serializable, Comparable<EResolverType>, java.lang.constant.Constable

public enum EResolverType extends Enum<EResolverType>
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().

See Also:
  • Enum Constant Details

    • DEFAULT

      public static final EResolverType DEFAULT
      Use global TBaseType settings to determine which resolver to use. This is the default behavior for backward compatibility.

      Resolution order:

      1. If TBaseType.isEnableResolver2() is true, use RESOLVER2
      2. Else if TBaseType.isEnableResolver() is true, use RESOLVER
      3. Else use NONE (no resolution)
    • RESOLVER

      public static final EResolverType RESOLVER
      Use the original TSQLResolver for name resolution. This is the legacy resolver that has been available since early versions.
    • RESOLVER2

      public static final EResolverType 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

      public static final EResolverType 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

      public static EResolverType[] 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

      public static EResolverType valueOf(String name)
      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 name
      NullPointerException - if the argument is null