Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.makumba.providers
Class QueryProvider

    java.lang.Object
      org.makumba.providers.QueryProvider

All Implemented Interfaces:
  SingletonHolder

Direct Known Subclasses:
  HQLQueryProvider, OQLQueryProvider

    public abstract class QueryProvider

extends Object
implements SingletonHolder

This provider makes it possible to run queries against a data source.

Version:
  $Id: QueryExecutionProvider.java,v 1.1 17.09.2007 15:16:57 Manuel Exp $
Author:
  Manuel Gay, Cristian Bogdan, Rudolf Mayer

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)`
`abstract Vector<Dictionary<String,Object>>` | `executeRaw(String query, Map args, int offset, int limit)` Executes a query with a given set of parameters
`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

### analyzersByClass

    static final Map<String,QueryAnalysisProvider> analyzersByClass

### analyzersByName

    static final Map<String,QueryAnalysisProvider> analyzersByName

### providerClasses

    static final Map<String,Class<?>> providerClasses

Constructor Detail

### QueryProvider

    public QueryProvider()

Method Detail

### getQueryAnalysisProviderClass

    protected String getQueryAnalysisProviderClass()

### getQueryAnalzyer

    public static QueryAnalysisProvider getQueryAnalzyer(String name)

  Provides the QueryAnalysisProvider for a given query language.

  Parameters:
    `name` - the name of the query language
  Returns:
    the QueryProvider able of performing analysis for this language

### makeQueryRunner

    public static QueryProvider makeQueryRunner(String dataSource,
                                                String name,
                                                Attributes a)

  Provides the query execution environment corresponding to the query language.

  Parameters:
    `dataSource` - the source on which the query should be run
    `name` - the name of the query execution provider (oql, hql, castorOql, ...)
  Returns:

### makeQueryRunner

    public static QueryProvider makeQueryRunner(String string,
                                                String queryLang)

### init

    protected void init(String dataSource,
                        Attributes a)

  Initalises the provider with the datasource

  Parameters:
    `dataSource` - the source on which the query should be run
    `a` -

### executeRaw

    public abstract Vector<Dictionary<String,Object>> executeRaw(String query,
                                                                 Map args,
                                                                 int offset,
                                                                 int limit)

  Executes a query with a given set of parameters

  Parameters:
    `query` - the query to execute
    `args` - the arguments of this query
    `offset` - from which record should results be returned
    `limit` - until which record should results be returned
  Returns:
    a Vector holding Dictionaries corresponding to a result

### execute

    public Vector<Dictionary<String,Object>> execute(String query,
                                                     Map args,
                                                     int offset,
                                                     int limit)

### close

    public abstract void close()

  Closes the environment, when all queries were executed

### getDataSource

    public String getDataSource()

  Gets the data source of the QueryProvider.

  Returns:
    the data source of the provider, may be null if it just does analysis

### release

    public void release()

  Specified by:
    `release` in interface `SingletonHolder`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Docs generated on 2009-02-25 14:20