--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/7e1a7966-2525-47d1-8dba-d64fbb069379%40googlegroups.com.
You don't have to call load in command handler on aggregate. Its automatically load by the Id you provided in memory. You need to provide only Id with annotations @TargetIdentifer in command.
On Thu, 7 May 2020, 7:15 am Meric, <ahe...@gmail.com> wrote:
Hi guys.--I've had the question for a long time. For most samples on Internet. They always creat one aggregate object first and then operate the aggregate objects. My question is, how can I load one from db other than create one every time. I'll take e-sopping as an example. I treat one product as an aggregate object. I can't load all of them into my program memory. So how can I do?What I do is, I write another constructor whit the parameter UpdateProductCommand as well as the constructor with parameter CreateProductCommand. In this constructor, I load it from db.Is this OK?class Product{public Product(){}@CommandHandlerpublic Product(CreateProductCommand command){apply(new CreateProductEvent(command.id));}@CommandHandlerpublic Product(UpdateProductCommand command){load(command.id)...apply(new UpdateProductEvent(command.id));}}
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonfr...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/780bf941-9e7d-4389-8d0d-08fdadd3cb22%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/780bf941-9e7d-4389-8d0d-08fdadd3cb22%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/6deafc4e-20bf-4caa-acd5-4c4131c8fd45%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/6deafc4e-20bf-4caa-acd5-4c4131c8fd45%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/6deafc4e-20bf-4caa-acd5-4c4131c8fd45%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/77c95d27-7396-4f54-9f54-81ceac85b249%40googlegroups.com.