Package com.blazebit.query
Interface Query
- All Known Subinterfaces:
TypedQuery<T>
public interface Query
An executable query to query data stored in the associated
QuerySession
.
The object is not thread-safe.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the properties and hints and associated values that are in effect for the Query.Returns the query string of this query.Returns the associatedQuerySession
that created this Query.setParameter
(int position, Object value) Sets a value for the 1-based positional query parameter at the given position.void
setProperty
(String propertyName, Object value) Set aQuery
property or hint.<T> T
Return an object of the specified type to allow access to the provider-specific API.
-
Method Details
-
getSession
QuerySession getSession()Returns the associatedQuerySession
that created this Query.- Returns:
- the associated
QuerySession
that created this Query
-
setParameter
Sets a value for the 1-based positional query parameter at the given position.- Parameters:
position
- The 1-based parameter positionvalue
- The parameter value to set- Returns:
this
object for method chaining- Throws:
IllegalArgumentException
- If the position is invalid or the given value has the wrong type
-
getQueryString
String getQueryString()Returns the query string of this query.- Returns:
- the query string of this query
-
setProperty
Set aQuery
property or hint. If a vendor-specific property or hint is not recognized, it is silently ignored.- Parameters:
propertyName
- name of property or hintvalue
- value for property or hint- Throws:
IllegalArgumentException
- if the second argument is not valid for the implementationIllegalStateException
- if the QuerySession is closed
-
getProperties
Returns the properties and hints and associated values that are in effect for the Query. Changing the contents of the map does not change the configuration in effect.- Returns:
- map of properties and hints in effect for the Query
- Throws:
IllegalStateException
- if the QuerySession is closed
-
unwrap
Return an object of the specified type to allow access to the provider-specific API. If the implementation does not support the specified class, theIllegalArgumentException
is thrown.- Type Parameters:
T
- The return type- Parameters:
cls
- the class of the object to be returned- Returns:
- The unwrapped object
- Throws:
IllegalArgumentException
- if the type is not supportedIllegalStateException
- if the QuerySession is closed
-