public class DynamicQueryConfig extends Object
Can be used as special repository method parameter to provide at runtime:
Query.dynamicQuery()
== true)
* Please, note that Query
annotation parameters will be ignored in favor of those defined in
DynamicQueryConfig
parameter if present.
Constructor and Description |
---|
DynamicQueryConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
collocated()
Sets flag defining if this query is collocated.
|
boolean |
distributedJoins()
Specify if distributed joins are enabled for this query.
|
boolean |
enforceJoinOrder()
Sets flag to enforce join order of tables in the query.
|
boolean |
forceFieldsQuery()
Force SqlFieldsQuery type, deactivating auto-detection based on SELECT statement.
|
static DynamicQueryConfig |
fromQueryAnnotation(Query queryConfiguration)
From Query annotation.
|
boolean |
lazy()
Sets lazy query execution flag.
|
int |
limit()
Gets limit to response records count for TextQuery.
|
boolean |
local()
Sets whether this query should be executed on local node only.
|
int[] |
parts()
Sets partitions for a query.
|
DynamicQueryConfig |
setCollocated(boolean collocated)
Sets collocated.
|
DynamicQueryConfig |
setDistributedJoins(boolean distributedJoins)
Sets distributed joins.
|
DynamicQueryConfig |
setEnforceJoinOrder(boolean enforceJoinOrder)
Sets enforce join order.
|
DynamicQueryConfig |
setForceFieldsQuery(boolean forceFieldsQuery)
Sets force fields query.
|
DynamicQueryConfig |
setLazy(boolean lazy)
Sets lazy.
|
DynamicQueryConfig |
setLimit(int limit)
Sets limit to response records count for TextQuery.
|
DynamicQueryConfig |
setLocal(boolean local)
Sets local.
|
DynamicQueryConfig |
setParts(int[] parts)
Sets parts.
|
DynamicQueryConfig |
setTextQuery(boolean textQuery)
Sets text query.
|
DynamicQueryConfig |
setTimeout(int timeout)
Sets timeout.
|
DynamicQueryConfig |
setValue(String value)
Sets value.
|
boolean |
textQuery()
Whether must use TextQuery search.
|
int |
timeout()
Query timeout in millis.
|
String |
value()
Query text string.
|
public static DynamicQueryConfig fromQueryAnnotation(Query queryConfiguration)
queryConfiguration
- the query configurationpublic String value()
public boolean textQuery()
public boolean forceFieldsQuery()
public boolean collocated()
Collocation flag is used for optimization purposes of queries with GROUP BY statements. Whenever Ignite executes a distributed query, it sends sub-queries to individual cluster members. If you know in advance that the elements of your query selection are collocated together on the same node and you group by collocated key (primary or affinity key), then Ignite can make significant performance and network optimizations by grouping data on remote nodes.
Only applicable to SqlFieldsQuery
public int timeout()
Only applicable to SqlFieldsQuery and SqlQuery
public boolean enforceJoinOrder()
true
query optimizer will not reorder
tables in join. By default is false
.
It is not recommended to enable this property until you are sure that your indexes and the query itself are correct and tuned as much as possible but query optimizer still produces wrong join order.
Only applicable to SqlFieldsQuery
public boolean distributedJoins()
Only applicable to SqlFieldsQuery and SqlQuery
public boolean lazy()
By default Ignite attempts to fetch the whole query result set to memory and send it to the client. For small and medium result sets this provides optimal performance and minimize duration of internal database locks, thus increasing concurrency.
If result set is too big to fit in available memory this could lead to excessive GC pauses and even OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory consumption at the cost of moderate performance hit.
Defaults to false
, meaning that the whole result set is fetched to memory eagerly.
Only applicable to SqlFieldsQuery
public boolean local()
public int[] parts()
Note what passed array'll be sorted in place for performance reasons, if it wasn't sorted yet.
Only applicable to SqlFieldsQuery and SqlQuery
public int limit()
public DynamicQueryConfig setValue(String value)
value
- the valuepublic DynamicQueryConfig setTextQuery(boolean textQuery)
textQuery
- the text querypublic DynamicQueryConfig setForceFieldsQuery(boolean forceFieldsQuery)
forceFieldsQuery
- the force fields querypublic DynamicQueryConfig setCollocated(boolean collocated)
collocated
- the collocatedpublic DynamicQueryConfig setTimeout(int timeout)
timeout
- the timeoutpublic DynamicQueryConfig setEnforceJoinOrder(boolean enforceJoinOrder)
enforceJoinOrder
- the enforce join orderpublic DynamicQueryConfig setDistributedJoins(boolean distributedJoins)
distributedJoins
- the distributed joinspublic DynamicQueryConfig setLazy(boolean lazy)
lazy
- the lazypublic DynamicQueryConfig setLocal(boolean local)
local
- the localpublic DynamicQueryConfig setParts(int[] parts)
parts
- the partspublic DynamicQueryConfig setLimit(int limit)
limit
- If 0 or less, considered to be no limit.this
For chaining.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024