public final class Query<T> implements Queryable<T>, RelationalQuerySource, PolicyAwareQuerySource:
Immutable, lazy and re-executable typed KQL query.
A query is not a collection. Execution occurs only through an explicit terminal operation such as toList(), count(), or stream().
active = query: from users user where user.active rows = active.toList()
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | planplan as QueryPlanView: |
Returns the provider-safe immutable plan summary. |
| public readonly property | relationalPushdownrelationalPushdown as Boolean: |
True when the wrapped source supports complete relational pushdown. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Query | Creates a lazy query from a provider source and immutable typed plan. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | asQueryasQuery() as Query<T>: |
Returns this immutable query. |
| public | countcount() as Long: |
Counts result rows through the provider count operation. |
| public | countPlancountPlan(plan as QueryPlanBase) as Long: |
Counts rows produced by an outer plan. |
| public | entityPoliciesentityPolicies() as IList<QirEntityPolicy>: |
Propagates manager policies through query and join composition. |
| public | executePlanexecutePlan(plan as QueryPlanBase) as Object: |
Applies an outer typed plan to this query. |
| public | existsexists() as Boolean: |
Tests whether at least one row exists. |
| public | existsPlanexistsPlan(plan as QueryPlanBase) as Boolean: |
Tests whether an outer plan produces a row. |
| public | explainexplain() as QueryExplanation: |
Returns a typed, redacted query explanation. |
| public | firstfirst() as T throws NoResultException: |
Returns the first row using a one-row provider window. |
| public | firstOrNullfirstOrNull() as Object: |
Returns the first row or null. |
| public | openStreamopenStream(plan as QueryPlanBase) as Object: |
Opens an outer plan as an independent sequential stream. |
| public | pagepage(request as PageRequest) as Page<T>: |
Materializes one page and obtains an exact total count. |
| public | planExecutionModeplanExecutionMode(plan as QueryPlanBase) as ProviderExecutionMode: |
Classifies an outer composed plan through the retained provider root. |
| public | planWarnings | Returns warnings for the complete retained provider plan. |
| public | providerCapabilitiesproviderCapabilities() as ProviderCapabilities: |
Delegates machine-readable capabilities to the retained provider root. |
| public | providerDomainproviderDomain() as Object: |
Returns the underlying provider-instance execution domain. |
| public | providerNameproviderName() as String: |
Returns the underlying provider identifier. |
| public | providerTextproviderText(plan as QueryPlanBase) as String: |
Returns provider text and explicitly identifies composed memory work. |
| public | relationalRootrelationalRoot() as QuerySource: |
Returns the provider root retained by this immutable query. |
| public | singlesingle() as T throws NoResultException, NonUniqueResultException: |
Returns the sole result row. |
| public | singleOrNullsingleOrNull() as Object throws NonUniqueResultException: |
Returns the sole row or null. |
| public | sliceslice(request as PageRequest) as Slice<T>: |
Materializes one page window without executing an exact count. |
| public | streamstream() as QueryStream<T>: |
Opens one independent forward-only result stream. |
| public | toListtoList() as List<T>: |
Executes and materializes the query into the standard list type. |
| public | toProviderTexttoProviderText() as String: |
Returns the privileged provider representation for diagnostics. |
| public | toSettoSet() as Set<T>: |
Executes and materializes unique result rows. |