Class ResultSetMappingQuery
- All Implemented Interfaces:
Query
-
Constructor Summary
ConstructorsConstructorDescriptionResultSetMappingQuery
(QueryHolder query, ConnectionWrapper connection, SparqlResultMapper mapper, UnitOfWork uow) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Execute an update or delete statement.int
The position of the first result the query object was set to retrieve.getHints()
Gets the hints and associated values that are in effect for this query instance.int
The maximum number of results the query object was set to retrieve.Parameter<?>
getParameter
(int position) Gets the parameter object corresponding to the declared positional parameter with the given position.Parameter<?>
getParameter
(String name) Gets the parameter object corresponding to the declared parameter of the given name.Gets the parameter objects corresponding to the declared parameters of the query.getParameterValue
(int position) Returns the input value bound to the positional parameter.<T> T
getParameterValue
(Parameter<T> parameter) Returns the input value bound to the parameter.getParameterValue
(String name) Returns the input value bound to the named parameter.boolean
hasParameter
(int position) boolean
hasParameter
(String name) boolean
Returns a boolean indicating whether a value has been bound to the parameter.Sets a query hint.setParameter
(int position, Object value) Binds an argument value to a positional parameter.setParameter
(int position, String value, String language) Binds a String argument value to a positional parameter.setParameter
(Parameter<String> parameter, String value, String language) Binds the value of a String Parameter.<T> Query
setParameter
(Parameter<T> parameter, T value) Binds the value of a Parameter object.setParameter
(String name, Object value) Binds an argument value to a named parameter.setParameter
(String name, String value, String language) Binds a String argument value to a named parameter.setUntypedParameter
(int position, Object value) Binds an argument value to a positional parameter.<T> Query
setUntypedParameter
(Parameter<T> parameter, T value) Binds the value of a Parameter object.setUntypedParameter
(String name, Object value) Binds an argument value to a named parameter.Methods inherited from class cz.cvut.kbss.jopa.model.QueryImpl
getResultList, getResultStream, getSingleResult, setFirstResult, setMaxResults
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cz.cvut.kbss.jopa.model.query.Query
executeUpdate, getFirstResult, getHints, getMaxResults, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, setHint, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setUntypedParameter, setUntypedParameter, setUntypedParameter
-
Constructor Details
-
ResultSetMappingQuery
public ResultSetMappingQuery(QueryHolder query, ConnectionWrapper connection, SparqlResultMapper mapper, UnitOfWork uow)
-
-
Method Details
-
executeUpdate
public void executeUpdate()Description copied from interface:Query
Execute an update or delete statement.- Specified by:
executeUpdate
in interfaceQuery
-
hasParameter
-
hasParameter
public boolean hasParameter(int position) -
getParameter
Description copied from interface:Query
Gets the parameter object corresponding to the declared positional parameter with the given position. This method is not required to be supported for native queries.- Specified by:
getParameter
in interfaceQuery
- Parameters:
position
- position- Returns:
- parameter object
-
getParameter
Description copied from interface:Query
Gets the parameter object corresponding to the declared parameter of the given name. This method is not required to be supported for native queries.- Specified by:
getParameter
in interfaceQuery
- Parameters:
name
- Parameter name- Returns:
- parameter object
-
getParameters
Description copied from interface:Query
Gets the parameter objects corresponding to the declared parameters of the query. Returns empty set if the query has no parameters. This method is not required to be supported for native queries.- Specified by:
getParameters
in interfaceQuery
- Returns:
- set of parameter objects
-
isBound
Description copied from interface:Query
Returns a boolean indicating whether a value has been bound to the parameter. -
getParameterValue
Description copied from interface:Query
Returns the input value bound to the named parameter.- Specified by:
getParameterValue
in interfaceQuery
- Parameters:
name
- parameter name- Returns:
- parameter value
-
getParameterValue
Description copied from interface:Query
Returns the input value bound to the positional parameter.- Specified by:
getParameterValue
in interfaceQuery
- Parameters:
position
- position- Returns:
- parameter value
-
getParameterValue
Description copied from interface:Query
Returns the input value bound to the parameter.- Specified by:
getParameterValue
in interfaceQuery
- Parameters:
parameter
- parameter object- Returns:
- parameter value
-
setParameter
Description copied from interface:Query
Binds an argument value to a positional parameter.This version exploits the type of the parameter value and maps it to the corresponding XSD datatype (if it exists).
- Specified by:
setParameter
in interfaceQuery
- Parameters:
position
- positionvalue
- parameter value- Returns:
- this query instance
- See Also:
-
setParameter
Description copied from interface:Query
Binds a String argument value to a positional parameter.- Specified by:
setParameter
in interfaceQuery
- Parameters:
position
- positionvalue
- parameter valuelanguage
- language tag for the parameter value- Returns:
- this query instance
-
setParameter
Description copied from interface:Query
Binds an argument value to a named parameter.This version exploits the type of the parameter value and maps it to the corresponding XSD datatype (if it exists).
- Specified by:
setParameter
in interfaceQuery
- Parameters:
name
- parameter namevalue
- parameter value- Returns:
- this query instance
- See Also:
-
setParameter
Description copied from interface:Query
Binds a String argument value to a named parameter.- Specified by:
setParameter
in interfaceQuery
- Parameters:
name
- parameter namevalue
- parameter valuelanguage
- language tag for the parameter value- Returns:
- this query instance
-
setUntypedParameter
Description copied from interface:Query
Binds an argument value to a positional parameter.This version does not express the type of the value in the query. Instead, it inserts the value directly into the query string. Can be useful e.g. for specifying OFFSET or LIMIT values.
- Specified by:
setUntypedParameter
in interfaceQuery
- Parameters:
position
- positionvalue
- parameter value- Returns:
- this query instance
-
setUntypedParameter
Description copied from interface:Query
Binds an argument value to a named parameter.This version does not express the type of the value in the query. Instead, it inserts the value directly into the query string. Can be useful e.g. for specifying OFFSET or LIMIT values.
- Specified by:
setUntypedParameter
in interfaceQuery
- Parameters:
name
- parameter namevalue
- parameter value- Returns:
- this query instance
-
getMaxResults
public int getMaxResults()Description copied from interface:Query
The maximum number of results the query object was set to retrieve.Returns Integer.MAX_VALUE if
Query.setMaxResults(int)
was not applied to the query object.- Specified by:
getMaxResults
in interfaceQuery
- Returns:
- maximum number of results
-
getFirstResult
public int getFirstResult()Description copied from interface:Query
The position of the first result the query object was set to retrieve.Returns 0 if
setFirstResult
was not applied to the query object.- Specified by:
getFirstResult
in interfaceQuery
- Returns:
- position of the first result
-
setParameter
Description copied from interface:Query
Binds the value of a Parameter object.This version exploits the type of the parameter value and maps it to the corresponding XSD datatype (if it exists).
- Specified by:
setParameter
in interfaceQuery
- Parameters:
parameter
- parameter objectvalue
- parameter value- Returns:
- this query instance
- See Also:
-
setParameter
Description copied from interface:Query
Binds the value of a String Parameter.- Specified by:
setParameter
in interfaceQuery
- Parameters:
parameter
- parameter objectvalue
- parameter valuelanguage
- language tag for the parameter value- Returns:
- this query instance
-
setUntypedParameter
Description copied from interface:Query
Binds the value of a Parameter object.This version does not express the type of the value in the query. Instead, it inserts the value directly into the query string. Can be useful e.g. for specifying OFFSET or LIMIT values.
- Specified by:
setUntypedParameter
in interfaceQuery
- Parameters:
parameter
- parameter objectvalue
- parameter value- Returns:
- this query instance
-
setHint
Description copied from interface:Query
Sets a query hint.The hints elements may be used to specify query properties and hints. Vendor-specific hints that are not recognized by a provider are silently ignored.
-
getHints
Description copied from interface:Query
Gets the hints and associated values that are in effect for this query instance.
-