Class ParsedQuery
- java.lang.Object
-
- net.ontopia.topicmaps.query.impl.basic.ParsedQuery
-
- All Implemented Interfaces:
ParsedQueryIF,ParsedStatementIF
public class ParsedQuery extends Object implements ParsedQueryIF
INTERNAL: Class used to represent parsed queries. The class wraps a query executer and a tolog query intance (as generated by the parser). The actual query execution is delegated to the query processor.
-
-
Field Summary
Fields Modifier and Type Field Description protected QueryProcessorprocessorprotected TologQueryquery
-
Constructor Summary
Constructors Constructor Description ParsedQuery(QueryProcessor processor, TologQuery query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryResultIFexecute()PUBLIC: Executes the query, returning the query result.QueryResultIFexecute(Map<String,?> arguments)PUBLIC: Executes the query binding the parameters in the query to the values given in the 'arguments' map, returning the query result.Collection<String>getAllVariables()PUBLIC: Returns all the variables used in the query, in no particular order.ListgetClauses()Collection<String>getCountedVariables()PUBLIC: Returns the variables that are counted in the select clause of the query.List<String>getOrderBy()PUBLIC: Returns the variables listed in the order by clause in the order they are given there.List<String>getSelectedVariables()PUBLIC: Returns the variables in the select clause of the query, in the order given there.protected List<String>getVariables(Collection<Variable> varnames)Object[]getVariableTypes(String varname)booleanisOrderedAscending(String name)PUBLIC: Returns true if the named variable is to be sorted in ascending order.StringtoString()
-
-
-
Field Detail
-
query
protected TologQuery query
-
processor
protected QueryProcessor processor
-
-
Constructor Detail
-
ParsedQuery
public ParsedQuery(QueryProcessor processor, TologQuery query)
-
-
Method Detail
-
getClauses
public List getClauses()
-
getSelectedVariables
public List<String> getSelectedVariables()
Description copied from interface:ParsedQueryIFPUBLIC: Returns the variables in the select clause of the query, in the order given there. If there is no select clause all the variables used in the query are returned, in no particular order.- Specified by:
getSelectedVariablesin interfaceParsedQueryIF- Returns:
- An immutable List of String objects.
-
getAllVariables
public Collection<String> getAllVariables()
Description copied from interface:ParsedQueryIFPUBLIC: Returns all the variables used in the query, in no particular order.- Specified by:
getAllVariablesin interfaceParsedQueryIF- Returns:
- An immutable Collection of String objects.
-
getCountedVariables
public Collection<String> getCountedVariables()
Description copied from interface:ParsedQueryIFPUBLIC: Returns the variables that are counted in the select clause of the query. They are returned in no particular order. If there are no counted variables, or if there is no select clause an empty collection is returned.- Specified by:
getCountedVariablesin interfaceParsedQueryIF- Returns:
- An immutable Collection of String objects.
-
getOrderBy
public List<String> getOrderBy()
Description copied from interface:ParsedQueryIFPUBLIC: Returns the variables listed in the order by clause in the order they are given there. In order to see which ones are ascending and which descending, use the isOrderedAscending method.- Specified by:
getOrderByin interfaceParsedQueryIF- Returns:
- An immutable List of String objects.
-
isOrderedAscending
public boolean isOrderedAscending(String name)
Description copied from interface:ParsedQueryIFPUBLIC: Returns true if the named variable is to be sorted in ascending order.- Specified by:
isOrderedAscendingin interfaceParsedQueryIF
-
execute
public QueryResultIF execute() throws InvalidQueryException
Description copied from interface:ParsedQueryIFPUBLIC: Executes the query, returning the query result. Query results are not cached, so results are up to date.- Specified by:
executein interfaceParsedQueryIF- Throws:
InvalidQueryException
-
execute
public QueryResultIF execute(Map<String,?> arguments) throws InvalidQueryException
Description copied from interface:ParsedQueryIFPUBLIC: Executes the query binding the parameters in the query to the values given in the 'arguments' map, returning the query result. Query results are not cached, so results are up to date.- Specified by:
executein interfaceParsedQueryIF- Throws:
InvalidQueryException
-
getVariables
protected List<String> getVariables(Collection<Variable> varnames)
-
-