Interface ScriptFileLoader


public interface ScriptFileLoader
An interface for loading SQL script files.

This interface is responsible for loading SQL script files that contain multiple SQL statements for batch execution. These scripts are typically used for database initialization, schema creation, or test data setup.

The default implementation uses ResourceUtil to load script files from the classpath, but custom implementations can be provided to load scripts from different sources or with different loading strategies.

Implementations of this interface can be configured through the Config.getScriptFileLoader() method.

  • Method Summary

    Modifier and Type
    Method
    Description
    default URL
    Loads a script file and returns its URL.
  • Method Details

    • loadAsURL

      default URL loadAsURL(String path)
      Loads a script file and returns its URL.

      This method takes a path to a script file and returns a URL that can be used to access the file's content. The default implementation uses ResourceUtil.getResource(String) to load the file from the classpath.

      Parameters:
      path - the path to the script file
      Returns:
      the URL to the script file, or null if the file cannot be found