Package gudusoft.gsqlparser.sqlcmds
Class SqlCmdsFactory
Object
gudusoft.gsqlparser.sqlcmds.SqlCmdsFactory
Factory for creating vendor-specific SQL command resolvers.
This factory ensures only the necessary vendor implementations are loaded,
reducing memory footprint and class loading overhead.
Thread-safe implementation that creates new instances on each request
to avoid shared mutable state between concurrent parser instances.
- Since:
- 3.1.0.9
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears the provider cache.static ISqlCmdsGets or creates a vendor-specific SQL command resolver.static intGets the number of cached providers (for monitoring/debugging).static voidsetUseModularProviders(boolean useModular) Sets whether to use modular providers or fall back to monolithic TSqlCmds.
-
Method Details
-
get
Gets or creates a vendor-specific SQL command resolver. Always creates a new instance to ensure thread safety (no shared mutable state).- Parameters:
vendor- Database vendor- Returns:
- SQL command resolver for the vendor
- Throws:
IllegalArgumentException- if vendor is null or unsupported
-
clearCache
Clears the provider cache. Useful for testing and memory management. -
setUseModularProviders
Sets whether to use modular providers or fall back to monolithic TSqlCmds.- Parameters:
useModular- true to use new modular system, false for monolithic
-
getCacheSize
Gets the number of cached providers (for monitoring/debugging).- Returns:
- Number of providers currently in cache
-