org.ametys.plugins.datainclusion.data.sql
Class SqlQuery

java.lang.Object
  extended by org.ametys.plugins.datainclusion.data.AbstractQuery
      extended by org.ametys.plugins.datainclusion.data.sql.SqlQuery
All Implemented Interfaces:
Query

public class SqlQuery
extends AbstractQuery

A query on a SQL server.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ametys.plugins.datainclusion.data.Query
Query.ResultType
 
Field Summary
protected  SqlDataSource _dataSource
          The SQL data source.
protected  String _queryString
          The query string.
 
Fields inherited from class org.ametys.plugins.datainclusion.data.AbstractQuery
_description, _id, _name, _parameters, _resultType
 
Fields inherited from interface org.ametys.plugins.datainclusion.data.Query
PARAMETER_MATCHER, PARAMETER_PATTERN
 
Constructor Summary
SqlQuery()
           
 
Method Summary
 QueryResult execute(Map parameterValues)
          Execute the query with the specified parameter values.
 Map<String,String> getAdditionalConfiguration()
          Get the additional query configuration information.
 SqlDataSource getDataSource()
          Get the datasource on which depends this query.
 List<String> getParameterNames()
          Get the query parameter names.
 String getQueryString()
          Get the SQL query string.
 String getType()
          Get the query type.
 void setDataSource(SqlDataSource dataSource)
          Set this query data source.
 void setQueryString(String queryString)
          Set the query string.
 
Methods inherited from class org.ametys.plugins.datainclusion.data.AbstractQuery
_buildParameters, getDescription, getId, getName, getResultType, setDescription, setId, setName, setResultType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dataSource

protected SqlDataSource _dataSource
The SQL data source.


_queryString

protected String _queryString
The query string.

Constructor Detail

SqlQuery

public SqlQuery()
Method Detail

getType

public String getType()
Description copied from interface: Query
Get the query type.

Returns:
the query type.

getQueryString

public String getQueryString()
Get the SQL query string.

Returns:
the SQL query string.

setQueryString

public void setQueryString(String queryString)
Set the query string.

Parameters:
queryString -

getParameterNames

public List<String> getParameterNames()
Description copied from interface: Query
Get the query parameter names.

Returns:
the query parameter names as a Collection.

getDataSource

public SqlDataSource getDataSource()
Description copied from interface: Query
Get the datasource on which depends this query.

Returns:
the datasource on which depends this query.

setDataSource

public void setDataSource(SqlDataSource dataSource)
Set this query data source.

Parameters:
dataSource -

getAdditionalConfiguration

public Map<String,String> getAdditionalConfiguration()
Description copied from interface: Query
Get the additional query configuration information.

Returns:
the additional query configuration information as a Map of String -> String.

execute

public QueryResult execute(Map parameterValues)
                    throws DataInclusionException
Description copied from interface: Query
Execute the query with the specified parameter values.

Parameters:
parameterValues - the parameter values as a Map (name -> value).
Returns:
the query result.
Throws:
DataInclusionException


Copyright © 2010 Anyware Services. All Rights Reserved.