SnapshotProperties

The fields of a snapshot record a query names, as QueryFields: the system fields and STATE, under which the aggregate's state lies. Each name is its path in upper snake case, a nested segment after __: OPERATOR__ID is operator.id.

The compiler generates a <State>Properties object for the state of each aggregate whose module has wow-query-api on its class path. It extends this class, so it carries these fields beside the state's own, which it names after the Kotlin properties of their full path: OrderStateProperties.STATE__STATUS is state.status, and STATE__ITEMS__PRODUCT_ID is state.items.productId, named inside STATE__ITEMS.elementMatch { }. Without a state at hand, the system fields are on the companion: SnapshotProperties.LAST_EVENT_TIME.

val query = listQuery {
filter {
OrderStateProperties.STATE__STATUS eq OrderStatus.PAID
OrderStateProperties.OPERATOR__ID eq "user-1"
}
sort { OrderStateProperties.LAST_EVENT_TIME.desc() }
}

Inheritors

Types

Link copied to clipboard

The system fields alone.

Properties

Link copied to clipboard

The aggregate's declared access attributes (@Access), by name: a single one's value, a multiple one's values; access names one of them. The built-in owner and space are OWNER_ID and SPACE_ID.

Link copied to clipboard

The aggregate's id, unique within its tenant.

Link copied to clipboard

Whether the aggregate is deleted; a query sees only the others unless it filters on the deletion state.

Link copied to clipboard

When the aggregate got its first event, in epoch milliseconds.

Link copied to clipboard

Who sent the command that created the aggregate, as OPERATOR.

Link copied to clipboard

When the aggregate got its last event, in epoch milliseconds.

Link copied to clipboard

Who sent the last command: {id, tenantId, crossScope}, or null for an anonymous caller.

Link copied to clipboard
Link copied to clipboard

The aggregate's owner, null when it has none.

Link copied to clipboard

The schedules the aggregate keeps: each rule by its key, {type, ...} as Wow's JSON writes it ({type: "cron", expression, zone, misfire}); schedule names one.

Link copied to clipboard

The aggregate's space, null when it has none.

Link copied to clipboard

The aggregate's state.

Link copied to clipboard

The aggregate's tenant.

Link copied to clipboard

The aggregate's version: the number of its events.

Functions

Link copied to clipboard
fun access(name: String): QueryField<*>

The access attribute name of ACCESS: access.<name>.

Link copied to clipboard
fun schedule(key: String): QueryField<*>

The schedule key of SCHEDULES: schedules.<key>, its rule.