Axon 0.6 deprecated Repository.load(UUID uuid) in favor of
Repository.load(UUID uuid, long version);
I have a practical question. When I look at the order example from the
jteam blog, this would mean that the OrderCommandHandler must pass the
expectedversion to the reporsitory handling the cancel and confirm
command:
@CommandHandler
public void confirmOrder(ConfirmOrderCommand command) {
Order order = orderRepository.load(new
StringAggregateIdentifier(command.getOrderId()));
order.confirm();
}
@CommandHandler
public void cancelOrder(CancelOrderCommand command) {
Order order = orderRepository.load(new
StringAggregateIdentifier(command.getOrderId()));
order.cancel();
}
My question is where the heck does it get the version from?
What is the meaning of the expectedVersion?
Jaron