|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.messaging.common.consumerlibrary.query.Query<CALL>
CALL
- public abstract class Query<CALL extends ConsumerCL>
Field Summary | |
---|---|
protected CALL |
call
|
protected SimpleDateFormat |
dateFormat
|
protected String |
groupClause
|
protected String |
limitClause
|
protected String |
orderClause
|
protected String |
query
|
protected String |
results
|
Constructor Summary | |
---|---|
Query()
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CALL extends ConsumerCL call
protected String results
protected String query
protected String orderClause
protected String limitClause
protected String groupClause
protected SimpleDateFormat dateFormat
Constructor Detail |
---|
public Query()
Method Detail |
---|
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 statement
QueryNotSetException
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
- public ArrayList<ArrayList<String>> getResultsAsArray() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |