Class NamePolicyFactory
Object
gudusoft.gsqlparser.sqlenv.calcite.NamePolicyFactory
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 Summary
ConstructorsConstructorDescriptionNamePolicyFactory(EDbVendor vendor) Creates a new NamePolicyFactory for the specified database vendor. -
Method Summary
Modifier and TypeMethodDescriptionGets or creates a SqlNameMatcher for the specified object type.Returns the database vendor associated with this factory.booleanConvenience method to check if a specific object type is case-sensitive for this vendor.
-
Constructor Details
-
NamePolicyFactory
Creates a new NamePolicyFactory for the specified database vendor.- Parameters:
vendor- the database vendor
-
-
Method Details
-
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
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
-