|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.providers.QueryProvider
public abstract class QueryProvider
This provider makes it possible to run queries against a data source.
Field Summary | |
---|---|
(package private) static Map<String,QueryAnalysisProvider> |
analyzersByClass
|
(package private) static Map<String,QueryAnalysisProvider> |
analyzersByName
|
(package private) static Map<String,Class<?>> |
providerClasses
|
Constructor Summary | |
---|---|
QueryProvider()
|
Method Summary | |
---|---|
abstract void |
close()
Closes the environment, when all queries were executed |
Vector<Dictionary<String,Object>> |
execute(String query,
Map args,
int offset,
int limit)
Executes a query with a given set of parameters |
protected abstract Vector<Dictionary<String,Object>> |
executeRaw(String query,
Map args,
int offset,
int limit)
|
String |
getDataSource()
Gets the data source of the QueryProvider. |
protected String |
getQueryAnalysisProviderClass()
|
static QueryAnalysisProvider |
getQueryAnalzyer(String name)
Provides the QueryAnalysisProvider for a given query language. |
protected void |
init(String dataSource,
Attributes a)
Initalises the provider with the datasource |
static QueryProvider |
makeQueryRunner(String string,
String queryLang)
|
static QueryProvider |
makeQueryRunner(String dataSource,
String name,
Attributes a)
Provides the query execution environment corresponding to the query language. |
void |
release()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final Map<String,QueryAnalysisProvider> analyzersByClass
static final Map<String,QueryAnalysisProvider> analyzersByName
static final Map<String,Class<?>> providerClasses
Constructor Detail |
---|
public QueryProvider()
Method Detail |
---|
protected String getQueryAnalysisProviderClass()
public static QueryAnalysisProvider getQueryAnalzyer(String name)
name
- the name of the query language
public static QueryProvider makeQueryRunner(String dataSource, String name, Attributes a)
dataSource
- the source on which the query should be runname
- the name of the query execution provider (oql, hql, castorOql, ...)
public static QueryProvider makeQueryRunner(String string, String queryLang)
protected void init(String dataSource, Attributes a)
dataSource
- the source on which the query should be runa
- protected abstract Vector<Dictionary<String,Object>> executeRaw(String query, Map args, int offset, int limit)
public Vector<Dictionary<String,Object>> execute(String query, Map args, int offset, int limit)
query
- the query to executeargs
- the arguments of this queryoffset
- from which record should results be returnedlimit
- until which record should results be returned
public abstract void close()
public String getDataSource()
public void release()
release
in interface SingletonHolder
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |