/** * Instantiate a {@link AbstractRepository} based on the fields contained in the {@link Builder}. * <p> * The provided Builder's main goal is to build an {@link AggregateModel} specifying generic {@code T} as the * aggregate type to be stored. All aggregates in this repository must be {@code instanceOf} this aggregate type. * To instantiate this AggregateModel, either an {@link AggregateModel} can be provided directly or an * {@code aggregateType} of type {@link Class} can be used. The latter will internally resolve to an * AggregateModel. Thus, either the AggregateModel <b>or</b> the {@code aggregateType} should be provided. An * {@link org.axonframework.common.AxonConfigurationException} is thrown if this criteria is not met. * * @param builder the {@link Builder} used to instantiate a {@link AbstractRepository} instance */ protected AbstractRepository(Builder<T> builder) { builder.validate(); this.aggregateModel = builder.buildAggregateModel(); }
/** * Instantiate a {@link AbstractRepository} based on the fields contained in the {@link Builder}. * <p> * The provided Builder's main goal is to build an {@link AggregateModel} specifying generic {@code T} as the * aggregate type to be stored. All aggregates in this repository must be {@code instanceOf} this aggregate type. * To instantiate this AggregateModel, either an {@link AggregateModel} can be provided directly or an * {@code aggregateType} of type {@link Class} can be used. The latter will internally resolve to an * AggregateModel. Thus, either the AggregateModel <b>or</b> the {@code aggregateType} should be provided. An * {@link org.axonframework.common.AxonConfigurationException} is thrown if this criteria is not met. * * @param builder the {@link Builder} used to instantiate a {@link AbstractRepository} instance */ protected AbstractRepository(Builder<T> builder) { builder.validate(); this.aggregateModel = builder.buildAggregateModel(); }