Class SqlCmdsFactory

Object
gudusoft.gsqlparser.sqlcmds.SqlCmdsFactory

public class SqlCmdsFactory extends Object
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 Details

    • get

      public static ISqlCmds get(EDbVendor vendor)
      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

      public static void clearCache()
      Clears the provider cache. Useful for testing and memory management.
    • setUseModularProviders

      public static void setUseModularProviders(boolean useModular)
      Sets whether to use modular providers or fall back to monolithic TSqlCmds.
      Parameters:
      useModular - true to use new modular system, false for monolithic
    • getCacheSize

      public static int getCacheSize()
      Gets the number of cached providers (for monitoring/debugging).
      Returns:
      Number of providers currently in cache