I’m learning Axon as I want to use it instead of JPA for my DDD and Event Sourcing.
As we do on JPA I can’t use @Embedded
and @EmbeddedId
for my custom ID
Is there anything like that for @AggregateIdentifier
?
I’m learning Axon as I want to use it instead of JPA for my DDD and Event Sourcing.
As we do on JPA I can’t use @Embedded
and @EmbeddedId
for my custom ID
Is there anything like that for @AggregateIdentifier
?
The @AggregateIdentifier
should work as long as the field produces meaningful and not memory-dependent .toString
output.
Thank you, Can you elaborate what do you mean by memory dependent?
Basically, the default .toString()
method from the Object
classes uses memory reference as part of its output; something like String@3849203842
. The value after @
is the memory location on heap. And since that changes with every object, even though they should be the same String or whatever object, it’s going to output different values. So the point is to always override the default toString()
unless something like data classes from Kotlin or Lombok annotations that generate the toString behind the scenes.