public final class SqlQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>>
IgniteCache.query(Query)
,
Serialized FormDFLT_PAGE_SIZE
Constructor and Description |
---|
SqlQuery(Class<?> type,
String sql)
Constructs query for the given type and SQL query.
|
SqlQuery(String type,
String sql)
Constructs query for the given type name and SQL query.
|
Modifier and Type | Method and Description |
---|---|
String |
getAlias()
Sets table alias for type.
|
Object[] |
getArgs()
Gets SQL arguments.
|
@Nullable int[] |
getPartitions()
Gets partitions for query, in ascending order.
|
String |
getSql()
Gets SQL clause.
|
int |
getTimeout()
Gets the query execution timeout in milliseconds.
|
String |
getType()
Gets type for query.
|
boolean |
isDistributedJoins()
Check if distributed joins are enabled for this query.
|
boolean |
isReplicatedOnly()
Deprecated.
No longer used as of Apache Ignite 2.8.
|
SqlQuery<K,V> |
setAlias(String alias)
Gets table alias for type.
|
SqlQuery<K,V> |
setArgs(Object... args)
Sets SQL arguments.
|
SqlQuery<K,V> |
setDistributedJoins(boolean distributedJoins)
Specify if distributed joins are enabled for this query.
|
SqlQuery<K,V> |
setLocal(boolean loc)
Sets whether this query should be executed on local node only.
|
SqlQuery<K,V> |
setPageSize(int pageSize)
Sets optional page size, if
0 , then default is used. |
SqlQuery |
setPartitions(int... parts)
Sets partitions for a query.
|
SqlQuery<K,V> |
setReplicatedOnly(boolean replicatedOnly)
Deprecated.
No longer used as of Apache Ignite 2.8.
|
SqlQuery<K,V> |
setSql(String sql)
Sets SQL clause.
|
SqlQuery<K,V> |
setTimeout(int timeout,
TimeUnit timeUnit)
Sets the query execution timeout.
|
SqlQuery<K,V> |
setType(Class<?> type) |
SqlQuery<K,V> |
setType(String type)
Sets type for query.
|
String |
toString() |
getPageSize, isLocal, prepare
public SqlQuery(String type, String sql)
type
- Type.sql
- SQL Query.public String getSql()
public SqlQuery<K,V> setSql(String sql)
sql
- SQL clause.this
For chaining.public Object[] getArgs()
public SqlQuery<K,V> setArgs(Object... args)
args
- SQL arguments.this
For chaining.public String getType()
public SqlQuery<K,V> setType(String type)
type
- Type.this
For chaining.public String getAlias()
public SqlQuery<K,V> setAlias(String alias)
alias
- table alias for type that is used in query.this
For chaining.public int getTimeout()
public SqlQuery<K,V> setTimeout(int timeout, TimeUnit timeUnit)
timeout
- Timeout value. Zero value disables timeout.timeUnit
- Time granularity.this
For chaining.public SqlQuery<K,V> setPageSize(int pageSize)
0
, then default is used.setPageSize
in class Query<javax.cache.Cache.Entry<K,V>>
pageSize
- Optional page size.this
for chaining.public SqlQuery<K,V> setLocal(boolean loc)
public SqlQuery<K,V> setType(Class<?> type)
type
- Type.this
For chaining.public SqlQuery<K,V> setDistributedJoins(boolean distributedJoins)
distributedJoins
- Distributed joins enabled.this
For chaining.public boolean isDistributedJoins()
true
If distributed joins enabled.@Deprecated public SqlQuery<K,V> setReplicatedOnly(boolean replicatedOnly)
replicatedOnly
- The query contains only replicated tables.this
For chaining.@Deprecated public boolean isReplicatedOnly()
true
If the query contains only replicated tables.@Nullable public @Nullable int[] getPartitions()
public SqlQuery setPartitions(@Nullable int... parts)
Note what passed array'll be sorted in place for performance reasons, if it wasn't sorted yet.
parts
- Partitions.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019