Class TSQLResolverConfig

Object
gudusoft.gsqlparser.resolver2.TSQLResolverConfig

public class TSQLResolverConfig extends Object
Configuration for TSQLResolver2. Controls various aspects of name resolution behavior.
  • Field Details

  • Constructor Details

  • Method Details

    • getNameMatcher

    • setNameMatcher

      public void setNameMatcher(INameMatcher nameMatcher)
    • isLegacyCompatibilityEnabled

      public boolean isLegacyCompatibilityEnabled()
    • setLegacyCompatibilityEnabled

      public void setLegacyCompatibilityEnabled(boolean enabled)
    • getLegacySyncMinConfidence

      public double getLegacySyncMinConfidence()
    • setLegacySyncMinConfidence

      public void setLegacySyncMinConfidence(double threshold)
    • getMaxIterations

      public int getMaxIterations()
    • setMaxIterations

      public void setMaxIterations(int maxIterations)
    • getMinProgressRate

      public double getMinProgressRate()
    • setMinProgressRate

      public void setMinProgressRate(double minProgressRate)
    • getStablePassesForConvergence

    • setStablePassesForConvergence

      public void setStablePassesForConvergence(int stablePasses)
    • isCollectFullCandidates

      public boolean isCollectFullCandidates()
    • setCollectFullCandidates

      public void setCollectFullCandidates(boolean collectFullCandidates)
    • isEvidenceCollectionEnabled

      public boolean isEvidenceCollectionEnabled()
      Deprecated.
      Use NamespaceEnhancer instead
    • setEvidenceCollectionEnabled

      public void setEvidenceCollectionEnabled(boolean enabled)
      Deprecated.
      Use NamespaceEnhancer instead
    • isShowDatatype

      public boolean isShowDatatype()
      Check if datatype information should be shown for columns from CREATE TABLE statements.
      Returns:
      true if datatype information should be included in column names
    • setShowDatatype

      public void setShowDatatype(boolean showDatatype)
      Set whether to show datatype information for columns from CREATE TABLE statements. When enabled, columns from CREATE TABLE will include datatype info in format: columnName:datatypeName:length or columnName:datatypeName:precision:scale
      Parameters:
      showDatatype - true to include datatype information
    • isShowCTE

      public boolean isShowCTE()
      Check if CTE (Common Table Expression) tables and columns should be shown in output.
      Returns:
      true if CTE tables and columns should be included
    • setShowCTE

      public void setShowCTE(boolean showCTE)
      Set whether to show CTE (Common Table Expression) tables and columns in output. When enabled, CTE tables are included in the tables list and CTE columns are included in the fields list with "(CTE)" suffix.
      Parameters:
      showCTE - true to include CTE tables and columns
    • getDisplayNameMode

      Get the display name mode.
      Returns:
      the current display name mode
    • setDisplayNameMode

      public void setDisplayNameMode(DisplayNameMode mode)
      Set the display name mode.
      Parameters:
      mode - the display name mode
    • getDisplayNamePolicy

      Get the display name policy.
      Returns:
      the current display name policy
    • setDisplayNamePolicy

      Set the display name policy.
      Parameters:
      policy - the display name policy
    • isStripDelimitersForDisplay

      public boolean isStripDelimitersForDisplay()
      Check if delimiters should be stripped for display.
      Returns:
      true if delimiters should be stripped
    • setStripDelimitersForDisplay

      public void setStripDelimitersForDisplay(boolean stripDelimiters)
      Set whether to strip delimiters for display.
      Parameters:
      stripDelimiters - true to strip delimiters
    • getGuessColumnStrategy

      public int getGuessColumnStrategy()
      Get the strategy for handling ambiguous columns. Returns the configured value, or TBaseType.GUESS_COLUMN_STRATEGY if not set.
      Returns:
      One of GUESS_COLUMN_STRATEGY_NEAREST, GUESS_COLUMN_STRATEGY_FARTHEST, or GUESS_COLUMN_STRATEGY_NOT_PICKUP
    • setGuessColumnStrategy

      public void setGuessColumnStrategy(int strategy)
      Set the strategy for handling ambiguous columns.
      Parameters:
      strategy - One of GUESS_COLUMN_STRATEGY_NEAREST, GUESS_COLUMN_STRATEGY_FARTHEST, or GUESS_COLUMN_STRATEGY_NOT_PICKUP
    • hasCustomGuessColumnStrategy

      public boolean hasCustomGuessColumnStrategy()
      Check if a custom guess column strategy has been set on this config. If false, the strategy from TBaseType.GUESS_COLUMN_STRATEGY will be used.
      Returns:
      true if a custom strategy is set
    • clearGuessColumnStrategy

      public void clearGuessColumnStrategy()
      Clear any custom guess column strategy, reverting to TBaseType.GUESS_COLUMN_STRATEGY.
    • getGuessColumnStrategyName

      Get the human-readable name for the current strategy.
      Returns:
      Strategy name (e.g., "GUESS_COLUMN_STRATEGY_NEAREST")
    • getMinDefiniteConfidence

      public double getMinDefiniteConfidence()
      Get the minimum confidence threshold for definite resolutions.
      Returns:
      Threshold value [0.0, 1.0]
    • setMinDefiniteConfidence

      public void setMinDefiniteConfidence(double threshold)
      Set the minimum confidence threshold for definite resolutions.
      Parameters:
      threshold - Threshold value [0.0, 1.0]
    • getMinConfidenceToGuess

      public double getMinConfidenceToGuess()
      Get the minimum confidence threshold to allow guessing.
      Returns:
      Threshold value [0.0, 1.0]
    • setMinConfidenceToGuess

      public void setMinConfidenceToGuess(double threshold)
      Set the minimum confidence threshold to allow guessing.
      Parameters:
      threshold - Threshold value [0.0, 1.0]
    • isAllowGuessWhenAllInferred

      public boolean isAllowGuessWhenAllInferred()
      Check if guessing is allowed when all candidates are inferred.
      Returns:
      true if guessing is allowed with inferred candidates
    • setAllowGuessWhenAllInferred

      public void setAllowGuessWhenAllInferred(boolean allow)
      Set whether to allow guessing when all candidates are inferred.
      Parameters:
      allow - true to allow guessing with inferred candidates
    • isDefiniteConfidence

      public boolean isDefiniteConfidence(double confidence)
      Check if a confidence value represents a definite resolution.
      Parameters:
      confidence - The confidence value to check
      Returns:
      true if the confidence is >= minDefiniteConfidence
    • canGuessWithConfidence

      public boolean canGuessWithConfidence(double confidence)
      Check if a confidence value is sufficient to allow guessing.
      Parameters:
      confidence - The confidence value to check
      Returns:
      true if the confidence is >= minConfidenceToGuess
    • createDefault

      Create a default configuration
    • createCaseSensitive

      Create configuration for case-sensitive matching
    • createStandalone

      Create configuration for standalone mode (no legacy sync)
    • createWithDatatype

      Create configuration with showDatatype enabled. This configuration includes datatype information for columns from CREATE TABLE statements.
    • createWithCTE

      Create configuration with showCTE enabled. This configuration includes CTE tables and columns in the output.
    • createForVendor

      Create configuration for a specific database vendor.

      This factory method creates a configuration with vendor-specific name matching rules. The VendorNameMatcher uses IdentifierService to properly handle case sensitivity and quote handling for each vendor.

      Example vendor behaviors:

      • Oracle: Unquoted identifiers fold to UPPER, quoted are case-sensitive
      • PostgreSQL: Unquoted identifiers fold to LOWER, quoted are case-sensitive
      • MySQL: Depends on lower_case_table_names setting
      • BigQuery: Table names are case-sensitive, column names are case-insensitive
      Parameters:
      vendor - the database vendor
      Returns:
      configuration with vendor-specific name matcher
    • createForVendorWithDatatype

      Create configuration for a specific database vendor with datatype display enabled.
      Parameters:
      vendor - the database vendor
      Returns:
      configuration with vendor-specific name matcher and datatype display
    • getVendor

      public EDbVendor getVendor()
      Get the database vendor, if set.
      Returns:
      the database vendor, or null if not set
    • setVendor

      public void setVendor(EDbVendor vendor)
      Set the database vendor and update name matcher accordingly.
      Parameters:
      vendor - the database vendor
    • hasVendor

      public boolean hasVendor()
      Check if vendor-specific name matching is enabled.
      Returns:
      true if a vendor is configured
    • toString

      public String toString()
      Overrides:
      toString in class Object