Package org.jdbi.v3.sqlobject.locator
Class SqlObjectClasspathSqlLocator
java.lang.Object
org.jdbi.v3.sqlobject.locator.SqlObjectClasspathSqlLocator
- All Implemented Interfaces:
SqlLocator
Locates SQL in
.sql files on the classpath for use with SqlQuery. Given a class and method name, for example
com.foo.Bar#query, load a classpath resource name like com/foo/Bar/query.sql and use it with the annotation. The contents are then parsed,
cached, and returned for use by a statement.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SqlObjectClasspathSqlLocator.Creates a new SqlObjectClasspathSqlLocator. -
Method Summary
Modifier and TypeMethodDescriptionlocate(Class<?> sqlObjectType, Method method, ConfigRegistry config) Locates and returns the SQL for the given SQL Object type and method.
-
Constructor Details
-
SqlObjectClasspathSqlLocator
public SqlObjectClasspathSqlLocator()Creates a new SqlObjectClasspathSqlLocator. Uses aClasspathSqlLocatorinstance that strips comments off. -
SqlObjectClasspathSqlLocator
Creates a new SqlObjectClasspathSqlLocator.- Parameters:
locator- AClasspathSqlLocatorinstance
-
-
Method Details
-
locate
Description copied from interface:SqlLocatorLocates and returns the SQL for the given SQL Object type and method.- Specified by:
locatein interfaceSqlLocator- Parameters:
sqlObjectType- the SQL object typemethod- the methodconfig- the config registry- Returns:
- the SQL for the given method.
-