Class AbstractSqlFileRepository

java.lang.Object
org.seasar.doma.jdbc.AbstractSqlFileRepository
All Implemented Interfaces:
SqlFileRepository
Direct Known Subclasses:
GreedyCacheSqlFileRepository, NoCacheSqlFileRepository

public abstract class AbstractSqlFileRepository extends Object implements SqlFileRepository
A skeletal implementation of the SqlFileRepository interface.
  • Constructor Details

    • AbstractSqlFileRepository

      public AbstractSqlFileRepository()
  • Method Details

    • getSqlFile

      public final SqlFile getSqlFile(Method method, String path, Dialect dialect)
      Description copied from interface: SqlFileRepository
      Returns the SQL file.
      Specified by:
      getSqlFile in interface SqlFileRepository
      Parameters:
      method - the DAO method
      path - the SQL file path
      dialect - the SQL dialect
      Returns:
      the SQL file
    • getSqlFileWithCacheControl

      protected abstract SqlFile getSqlFileWithCacheControl(Method method, String path, Dialect dialect)
      Returns the SQL file in consideration of cache control.
      Parameters:
      method - the Dao method
      path - the SQL file path
      dialect - the dialect
      Returns:
      the SQL file
      Throws:
      SqlFileNotFoundException - if the SQL file is not found
      JdbcException - if an error occurs
    • createSqlFile

      protected final SqlFile createSqlFile(Method method, String path, Dialect dialect)
      Creates the SQL file.
      Parameters:
      method - the Dao method
      path - the SQL file path
      dialect - the dialect
      Returns:
      the SQL file
    • getPrimaryPath

      protected final String getPrimaryPath(String path, Dialect dialect)
      Returns the primary path to find SQL file for specific RDBMS.
      Parameters:
      path - the SQL file path
      dialect - the dialect
      Returns:
      the primary path
    • parse

      protected final SqlNode parse(String sql)
      Parses the SQL string.
      Parameters:
      sql - the SQL string
      Returns:
      the SQL node
    • getSql

      protected String getSql(String path)
      Retrieves the SQL string from the SQL file.
      Parameters:
      path - the SQL file path
      Returns:
      the SQL string