CALL
- public abstract class Query<CALL extends ConsumerCL> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected CALL |
call |
protected SimpleDateFormat |
dateFormat |
protected String |
groupClause |
protected String |
limitClause |
protected String |
orderClause |
protected String |
query |
protected String |
results |
Constructor and Description |
---|
Query() |
Modifier and Type | Method and Description |
---|---|
CALL |
getCall()
get the CALL object
|
Long |
getDimensions(String tableName)
Get the dimension of the given table
|
String |
getGroupClause()
get the grouping clause
|
String |
getLimitClause()
get the limit clause
|
String |
getOrderClause()
get the order clause for this query
|
String |
getQuery()
Return the query string ( composed by the user query + grouping+ordering+limits)
|
String |
getResults()
Get the Query result stored inside the query object
|
ArrayList<ArrayList<String>> |
getResultsAsArray()
getResultsAsArray (first array contains columns names)
|
protected abstract String |
performQuery()
The method implemented by subclasses, that performed the query
|
void |
printQueryResults()
Debug operation, used to print on log query results
|
String |
query()
Generic SELECT/SHOW MYSQL query
|
void |
setCall(CALL call)
set the CALL object
|
void |
setGroupClause(String group)
set the grouping clause
|
void |
setLimitClause(Integer limit)
set the limit clause
|
void |
setLimitClause(Integer start,
Integer limit)
set the limit clause and starting index
|
void |
setOrderClause(String order)
set the order clause
|
void |
setQuery(String query)
set the Query
|
void |
setResults(String results)
set the results inside the query object
|
JSONArray |
toJSON()
get results as JSON object
|
protected CALL extends ConsumerCL call
protected String results
protected String query
protected String orderClause
protected String limitClause
protected String groupClause
protected SimpleDateFormat dateFormat
protected abstract String performQuery() throws Exception
Exception
public String query() throws Exception, QueryNotSetException
Exception
- if the query is not valid, or is not a SELECT/SHOW statementQueryNotSetException
public JSONArray toJSON() throws EmptyResultException
JSONException
EmptyResultException
public Long getDimensions(String tableName) throws Exception
tableName
- Exception
public void printQueryResults() throws Exception
JSONException
Exception
public CALL getCall()
public void setCall(CALL call)
call
- the call objectpublic String getResults()
public void setResults(String results)
results
- public String getQuery()
public void setQuery(String query)
query
- the querypublic String getOrderClause()
public void setOrderClause(String order)
order
- public String getLimitClause()
public void setLimitClause(Integer start, Integer limit)
limit
- start
- public void setLimitClause(Integer limit)
limit
- public String getGroupClause()
public void setGroupClause(String group)
group
- Copyright © 2015. All Rights Reserved.