- All Known Implementing Classes:
AbstractSqlFileRepository,GreedyCacheSqlFileRepository,NoCacheSqlFileRepository
public interface SqlFileRepository
A repository interface for managing and retrieving
SqlFile instances.
This repository is responsible for locating and loading SQL files that correspond to DAO
methods. The path to a SQL file is built from the fully qualified name of the DAO interface and
the method name. For example, when org.example.ExampleDao interface has a
selectAll method, the corresponding SQL file path is
META-INF/org/example/ExampleDao/selectAll.sql.
The implementation class must be thread safe.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidClears cache.getSqlFile(Method method, String path, Dialect dialect) Returns the SQL file.
-
Method Details
-
getSqlFile
Returns the SQL file.- Parameters:
method- the DAO methodpath- the SQL file pathdialect- the SQL dialect- Returns:
- the SQL file
- Throws:
DomaNullPointerException- if any arguments arenullDomaIllegalArgumentException- if themethodis not annotated withSqland thepathdoes not match the Ant-style glob pattern "META-INF/**/*.sql"SqlFileNotFoundException- if the SQL file is not foundJdbcException- if an error other than listed above occurs
-
clearCache
default void clearCache()Clears cache.
-