I have an abstract aggregate root and other concrete aggregates roots which inherit that abstract AR. I have created custom aggregate factory, which can create concrete uninitialized AR instances based on first domain event.
I also have only one repository for all concrete ARs.
Now I have two problems:
- How can I register my custom aggregate factory to that repository in spring xml?
<axon:event-sourcing-repository id=“abstractRepository” aggregate-type="…AbstractAggregate"/> … this will automatically inject org.axonframework.eventsourcing.GenericAggregateFactory
I tried also this:
<constructor-arg name="aggregateFactory" ref="myAggregateFactory"/> <constructor-arg name="eventStore" ref="eventStore"/> </bean>