CachedQuery.create {
where { has(Enemy.id) or has(Ally.id) } // Use where as root (only one allowed)
}
class CachedQueryBuilder
CachedQueryBuilder
()
|
Signature
constructor() Returns |
where
(
initializer
)
|
Creates a query using the <code>where</code> DSL block, matching the Query.Companion.where syntax.
This provides a consistent API with Query.Companion.where for familiarity. Only one <code>where</code> block is allowed per query - nested <code>where</code> calls are prevented at compile time.
The result of <code>where</code> has a <code>filter</code> method available, allowing filters to be applied only when <code>where</code> is used.
Example:
CachedQuery.create {
where { has(Enemy.id, Health.id) } // Same as: has(Enemy.id, Health.id)
}
CachedQuery.create {
where { has(Enemy.id) }.filter { by(Enemy.statusData).isEqualTo(Status.ACTIVE) }
}
Signature
fun where(initializer: CachedQueryWhereBuilder.() -> CachedQueryNode): FilteredCachedQueryNode.Unfiltered Parameters
initializer:
Function1
Returns
FilteredCachedQueryNode.Unfiltered
|