Package cz.cvut.kbss.jopa.query.sparql
Class TokenStreamSparqlQueryHolder
java.lang.Object
cz.cvut.kbss.jopa.query.sparql.TokenStreamSparqlQueryHolder
- All Implemented Interfaces:
QueryHolder
-
Method Summary
Modifier and TypeMethodDescriptionAssembles the query, using any parameter values specified, and returns it as a string.voidclearParameter(Parameter<?> parameter) Clears any previously set value of the specified parameter.voidClears any previously set parameter values in this query.intGets the currently set first result position.intGets the currently set maximum number of results to retrieveParameter<?>getParameter(int position) Gets a parameter with the specified position.getParameter(String name) Gets a parameter with the specified name.Gets a collection of parameters in the query.getParameterValue(Parameter<?> parameter) Gets value bound to the specified parameter.Gets the list of query parameters that appear in the SELECT projection clause (in the order in which they are declared).getQuery()Gets the original query string.Gets a collection of parameters in the query.Gets the type of this query.booleanhasLimit()booleanbooleanhasParameter(int position) Checks whether the query has a parameter at the specified position.booleanhasParameter(String name) Checks whether the query has a parameter with the specified name.voidsetAssemblyModifier(SparqlAssemblyModifier modifier) voidsetFirstResult(int startPosition) Sets the position of the first result to retrieve.voidsetMaxResults(int maxResults) Sets the maximum number of results the query should retrieve.<T> voidsetParameter(Parameter<T> parameter, Object value) Sets value of the specified parameter in the query.<T> voidsetParameter(Parameter<T> parameter, String value, String language) Sets value of the specified parameter in the query.<T> voidsetUntypedParameter(Parameter<T> parameter, Object value) Sets value of the specified parameter in the query.
-
Method Details
-
setAssemblyModifier
-
getQuery
Description copied from interface:QueryHolderGets the original query string.- Specified by:
getQueryin interfaceQueryHolder- Returns:
- Gets the original unparsed query
-
getParameters
Description copied from interface:QueryHolderGets a collection of parameters in the query.- Specified by:
getParametersin interfaceQueryHolder- Returns:
- Parameter objects
-
getQueryParameters
Description copied from interface:QueryHolderGets a collection of parameters in the query.This returns the same set as
QueryHolder.getParameters(), but it returns more specific typeQueryParameter.- Specified by:
getQueryParametersin interfaceQueryHolder- Returns:
- Parameter objects
-
getProjectedQueryParameters
Description copied from interface:QueryHolderGets the list of query parameters that appear in the SELECT projection clause (in the order in which they are declared).- Specified by:
getProjectedQueryParametersin interfaceQueryHolder- Returns:
- Projected query parameters
-
hasParameter
Description copied from interface:QueryHolderChecks whether the query has a parameter with the specified name.- Specified by:
hasParameterin interfaceQueryHolder- Parameters:
name- Parameter name- Returns:
trueif the query has a matching parameter,falseotherwise
-
hasParameter
public boolean hasParameter(int position) Description copied from interface:QueryHolderChecks whether the query has a parameter at the specified position.- Specified by:
hasParameterin interfaceQueryHolder- Parameters:
position- Parameter position- Returns:
trueif the query has a matching parameter,falseotherwise
-
getParameter
Description copied from interface:QueryHolderGets a parameter with the specified name.- Specified by:
getParameterin interfaceQueryHolder- Parameters:
name- Parameter name- Returns:
- Parameter object
-
getParameter
Description copied from interface:QueryHolderGets a parameter with the specified position.- Specified by:
getParameterin interfaceQueryHolder- Parameters:
position- Parameter position- Returns:
- Parameter object
-
getParameterValue
Description copied from interface:QueryHolderGets value bound to the specified parameter.- Specified by:
getParameterValuein interfaceQueryHolder- Parameters:
parameter- Parameter- Returns:
- parameter value
-
setParameter
Description copied from interface:QueryHolderSets value of the specified parameter in the query.If a value was already specified for the parameter, it is overwritten by the new one. This version expresses the value type information using XSD datatype in the query string.
- Specified by:
setParameterin interfaceQueryHolder- Type Parameters:
T- Type of the parameter- Parameters:
parameter- Parameter objectvalue- Value to use- See Also:
-
setParameter
Description copied from interface:QueryHolderSets value of the specified parameter in the query.If a value was already specified for the parameter, it is overwritten by the new one.
- Specified by:
setParameterin interfaceQueryHolder- Type Parameters:
T- Type of the parameter- Parameters:
parameter- Parameter objectvalue- String value to uselanguage- Parameter language
-
setUntypedParameter
Description copied from interface:QueryHolderSets value of the specified parameter in the query.If a value was already specified for the parameter, it is overwritten by the new one. This version inserts the string representation of the value directly into the query, without any type information.
- Specified by:
setUntypedParameterin interfaceQueryHolder- Parameters:
parameter- Parameter objectvalue- Value to use- See Also:
-
setFirstResult
public void setFirstResult(int startPosition) Description copied from interface:QueryHolderSets the position of the first result to retrieve.- Specified by:
setFirstResultin interfaceQueryHolder- Parameters:
startPosition- The position to set, starting at 0
-
getFirstResult
public int getFirstResult()Description copied from interface:QueryHolderGets the currently set first result position.- Specified by:
getFirstResultin interfaceQueryHolder- Returns:
- the first result position, 0 if none was set
-
hasOffset
public boolean hasOffset() -
setMaxResults
public void setMaxResults(int maxResults) Description copied from interface:QueryHolderSets the maximum number of results the query should retrieve.- Specified by:
setMaxResultsin interfaceQueryHolder- Parameters:
maxResults- The maximum number of results
-
getMaxResults
public int getMaxResults()Description copied from interface:QueryHolderGets the currently set maximum number of results to retrieve- Specified by:
getMaxResultsin interfaceQueryHolder- Returns:
- Maximum results value,
Integer.MAX_VALUEwhen none was set
-
hasLimit
public boolean hasLimit() -
clearParameter
Description copied from interface:QueryHolderClears any previously set value of the specified parameter.- Specified by:
clearParameterin interfaceQueryHolder- Parameters:
parameter- Parameter object
-
clearParameters
public void clearParameters()Description copied from interface:QueryHolderClears any previously set parameter values in this query.- Specified by:
clearParametersin interfaceQueryHolder
-
assembleQuery
Description copied from interface:QueryHolderAssembles the query, using any parameter values specified, and returns it as a string.- Specified by:
assembleQueryin interfaceQueryHolder- Returns:
- Assembled query
-
getQueryType
Description copied from interface:QueryHolderGets the type of this query.- Specified by:
getQueryTypein interfaceQueryHolder- Returns:
- Query type
-
getQueryAttributes
-