Interface IWorkDirs

All Known Implementing Classes:
AbstractWorkDirs, ChWorkDirs, MsWorkDirs, PgWorkDirs

public interface IWorkDirs
Project directory layout. Describes which directory name is associated with each database object type and resolves per-object file locations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Map<String,? extends IDirRule>
    Returns the mapping of configurable type names to their placement rules.
    Returns the current directory name of the generic rule for the given type.
    Computes the relative path (inside a project directory) where the given statement should be stored.
    boolean
    Returns true if objects are organized into subdirectories per schema/database container, false if the schema name is encoded in the filename instead.
    void
    saveAltDirs(Path projectPath)
    Persists the current directory layout overrides to the given project.
  • Field Details

  • Method Details

    • isSplitBySchema

      boolean isSplitBySchema()
      Returns true if objects are organized into subdirectories per schema/database container, false if the schema name is encoded in the filename instead.
    • getDirMapping

      Map<String,? extends IDirRule> getDirMapping()
      Returns the mapping of configurable type names to their placement rules. Defines which object types participate in the project layout and may be overridden by external configuration.

      Keys are type names (e.g. TABLE, VIEW, TRIGGER_FUNC). Values are IDirRule instances carrying the current directory name (default or overridden) together with matching metadata.

      Returns:
      map of type names to their placement rules
    • getRelativeFilePath

      Path getRelativeFilePath(IStatement st)
      Computes the relative path (inside a project directory) where the given statement should be stored. Walks up ISubElement chains so that sub-elements share the file of their parent.
      Parameters:
      st - statement to locate
      Returns:
      project-relative path to the statement's SQL file
    • getDirNameForType

      String getDirNameForType(DbObjType type)
      Returns the current directory name of the generic rule for the given type. Specific-subset rules (e.g. MAT_VIEW, TRIGGER_FUNC) are skipped so the result reflects where the "regular" objects of the type live.
      Parameters:
      type - object type
      Returns:
      directory name, or null if no generic rule is registered
    • saveAltDirs

      void saveAltDirs(Path projectPath) throws IOException
      Persists the current directory layout overrides to the given project. Implementations write only entries that differ from the defaults, so an unchanged layout may produce an empty file.
      Parameters:
      projectPath - target project directory; must exist
      Throws:
      IOException - if the configuration file cannot be written