Class NamePolicyFactory

Object
gudusoft.gsqlparser.sqlenv.calcite.NamePolicyFactory

public class NamePolicyFactory extends Object
Factory for creating SqlNameMatcher instances per database vendor and object type.

This class bridges GSP's existing case sensitivity configuration (stored in TSQLEnv's EnumMaps) to Apache Calcite's SqlNameMatcher framework.

Design rationale: Instead of duplicating vendor-specific case rules, this factory reads from TSQLEnv's existing static maps and creates appropriate matchers on demand.

Since:
3.2.0.3 (Phase 1)
  • Constructor Details

    • NamePolicyFactory

      public NamePolicyFactory(EDbVendor vendor)
      Creates a new NamePolicyFactory for the specified database vendor.
      Parameters:
      vendor - the database vendor
  • Method Details

    • getVendor

      public EDbVendor getVendor()
      Returns the database vendor associated with this factory.
      Returns:
      the database vendor
    • getMatcherForType

      Gets or creates a SqlNameMatcher for the specified object type.

      The matcher's case sensitivity is determined by querying TSQLEnv's static maps (columnCollationCaseSensitive, tableCollationCaseSensitive, etc.)

      Results are cached to avoid repeated map lookups.

      Parameters:
      type - the SQL data object type (table, column, function, etc.)
      Returns:
      a SqlNameMatcher configured for the vendor/type combination
    • isCaseSensitive

      public boolean isCaseSensitive(ESQLDataObjectType type)
      Convenience method to check if a specific object type is case-sensitive for this vendor.
      Parameters:
      type - the object type
      Returns:
      true if case-sensitive, false otherwise