Package net.sf.jkniv.sqlegance
Interface SqlContext
-
public interface SqlContextMain interface to load and access the set of queries defined at XML files for an application.- Since:
- 0.6.0
- Author:
- Alisson Gomes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Sqladd(Sql sql)voidclose()Closes this SQL context.booleancontainsQuery(String name)StringgetName()Return context name that belong the statementsList<Sql>getPackage(String packageName)Retrieve all queries from packageMap<String,List<Sql>>getPackageStartWith(String packageName)Retrieve all packages starting withpackagetName.SqlgetQuery(String name)Retrieve one query according your name.RepositoryConfiggetRepositoryConfig()SqlDialectgetSqlDialect()voidsetSqlDialect(SqlDialect sqlDialect)
-
-
-
Method Detail
-
getName
String getName()
Return context name that belong the statements- Returns:
- context name
-
getQuery
Sql getQuery(String name)
Retrieve one query according your name.- Parameters:
name- Name of the query.- Returns:
- Return the query object with SQL.
- Throws:
IllegalArgumentException- if the parameter name does not refer names of query configured this exception is thrower.
-
getPackage
List<Sql> getPackage(String packageName)
Retrieve all queries from package- Parameters:
packageName- name of package- Returns:
- the list of queries that belong this package, if any one query ins't find a empty list is returned.
-
getPackageStartWith
Map<String,List<Sql>> getPackageStartWith(String packageName)
Retrieve all packages starting withpackagetName.- Parameters:
packageName- name of package- Returns:
- Map with found packages, where each key it is a package
-
containsQuery
boolean containsQuery(String name)
-
getRepositoryConfig
RepositoryConfig getRepositoryConfig()
-
getSqlDialect
SqlDialect getSqlDialect()
-
setSqlDialect
void setSqlDialect(SqlDialect sqlDialect)
-
close
void close()
Closes this SQL context. After close the SQL context the access to SQL is lost and retrieve a SQLQueryNotFoundExceptionis throw.
-
-