public abstract class EntityPolicy<T> implements EntityPolicyRegistration
Typed mandatory filter applied before provider lowering.
Implementations return a KQL query over the supplied source. The compiler therefore validates the policy with ordinary KQL rules, and SQL providers receive its canonical QIR rather than an opaque callback.
@QueryPolicy
public class ActiveCustomerPolicy extends EntityPolicy<Customer>:
public override apply(
source as Queryable<Customer>,
context as PolicyContext
) as Query<Customer>:
return query:
from source customer
where customer.active| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | entityTypeentityType as Type |
Exact entity type protected by this policy. |
| public readonly property | policyTypepolicyType as Type |
Concrete policy type used by authorization and audit events. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | allowsallows(entity as Object, context as PolicyContext) as Boolean |
Evaluates the identical policy over one materialized entity. |
| public abstract | applyapply(
source as Queryable<T>,
context as PolicyContext
) as Query<T> |
Builds the mandatory typed query filter. |
| public | applyUntypedapplyUntyped(source as Object, context as PolicyContext) as Object |
Applies this policy through the heterogeneous factory registry. |
| public | canonicalPolicycanonicalPolicy(context as PolicyContext) as QirEntityPolicy |
Compiles this policy once to the canonical QIR used by all providers. |