public class QueryBinder extends Object
Modifier and Type | Method and Description |
---|---|
QueryBinder |
bind(Map<String,Object> namedParams,
Object... params)
Bind the query with the given named and/or positional parameters.
|
QueryBinder |
bind(String name,
Object value)
Bind the given named parameter with the given value.
|
Query |
getQuery()
Get the underlying query instance.
|
static QueryBinder |
of(Query query)
Create a new query binder for the given query instance.
|
QueryBinder |
opts(boolean cacheable,
FlushModeType type)
Shortcut to the
setCacheable() and
setFlushMode(FlushModeType) methods. |
QueryBinder |
setCacheable()
Set the query cacheable.
|
QueryBinder |
setCacheable(boolean cacheable)
Set whether to set the query cacheable or not.
|
QueryBinder |
setFlushMode(FlushModeType mode)
Set query flush mode.
|
public static QueryBinder of(Query query)
query
- the query instancepublic QueryBinder setCacheable()
public QueryBinder setCacheable(boolean cacheable)
cacheable
- whether to set cacheable or notpublic QueryBinder setFlushMode(FlushModeType mode)
mode
- flush modepublic QueryBinder opts(boolean cacheable, FlushModeType type)
setCacheable()
and
setFlushMode(FlushModeType)
methods.cacheable
- whether to mark the query cacheabletype
- the FlushModeType
, only set if type is not nullpublic QueryBinder bind(Map<String,Object> namedParams, Object... params)
namedParams
- the named parametersparams
- the positional parameterspublic QueryBinder bind(String name, Object value)
name
- the named parametervalue
- the parameter valuepublic Query getQuery()