Hi!
I am new in Axon and I need help.
I faced with the problem.
I am trying to develop CRUD for one Entity.
Now I have developed aggreate.
@Aggregate
class UpdatePermission() {
@AggregateIdentifier
private var id: AxxalonIdentifier? = null
@CommandHandler
constructor(command: UpdatePermissionCommand) : this() {
var a = AggregateLifecycle.apply(PermissionUpdateEvent(command.id, command.title))
}
@CommandHandler
constructor(command: CreatePermissionCommand) : this() {
var a = AggregateLifecycle.apply(PermissionCreatedEvent(command.id, command.title))
}
@EventSourcingHandler(payloadType = PermissionUpdateEvent::class)
fun on(event: PermissionUpdateEvent) {
this.id = event.id
}
@EventSourcingHandler(payloadType = PermissionCreatedEvent::class)
fun on(event: PermissionCreatedEvent) {
this.id = event.id
}
}
And I have the problem with the aggregate.
What is wrong? Do I need a saga for create/update/delete entity by command and event?
Thank you very much for advice!