
org.seedstack.business.assembler.dsl.MergeFromRepository Maven / Gradle / Ivy
/*
* Copyright © 2013-2024, The SeedStack authors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.seedstack.business.assembler.dsl;
import org.seedstack.business.assembler.AggregateId;
import org.seedstack.business.assembler.FactoryArgument;
import java.lang.annotation.Annotation;
/**
* An element of the {@link FluentAssembler DSL} allowing to specify whether the aggregates should
* be retrieved from a repository or created from a factory.
**/
public interface MergeFromRepository {
/**
* Loads the aggregates from their repository. It uses the {@link AggregateId} annotation on
* the DTO to find the aggregate IDs.
*
* @return the next element of the DSL.
*/
MergeFromRepositoryOrFactory fromRepository();
/**
* Loads the aggregates from their repository, allowing to specify the qualifier of the repository to use.
* It uses the {@link AggregateId} annotation on the DTO to find the aggregate IDs.
*
* @param qualifier the qualifier annotation.
* @return the next element of the DSL.
*/
MergeFromRepositoryOrFactory fromRepository(Annotation qualifier);
/**
* Loads the aggregates from their repository, allowing to specify the qualifier of the repository to use.
* It uses the {@link AggregateId} annotation on the DTO to find the aggregate IDs.
*
* @param qualifier the string qualifier, interpreted as a {@code @Named} annotation with the corresponding value.
* @return the next element of the DSL.
*/
MergeFromRepositoryOrFactory fromRepository(String qualifier);
/**
* Loads the aggregates from their repository, allowing to specify the qualifier of the repository to use.
* It uses the {@link AggregateId} annotation on the DTO to find the aggregate IDs.
*
* @param qualifier the qualifier annotation class.
* @return the next element of the DSL.
*/
MergeFromRepositoryOrFactory fromRepository(Class extends Annotation> qualifier);
/**
* Create the aggregates from their factory. It uses the {@link FactoryArgument} annotation on
* the DTO to find the factory method parameters.
*
* @return the next element of the DSL.
*/
T fromFactory();
/**
* Create the aggregates from their factory, allowing to specify the qualifier of the factory to use.
* It uses the {@link FactoryArgument} annotation on the DTO to find the factory method parameters.
*
* @param qualifier the qualifier annotation.
* @return the next element of the DSL.
*/
T fromFactory(Annotation qualifier);
/**
* Create the aggregates from their factory, allowing to specify the qualifier of the factory to use.
* It uses the {@link FactoryArgument} annotation on the DTO to find the factory method parameters.
*
* @param qualifier the string qualifier, interpreted as a {@code @Named} annotation with the corresponding value.
* @return the next element of the DSL.
*/
T fromFactory(String qualifier);
/**
* Create the aggregates from their factory, allowing to specify the qualifier of the factory to use.
* It uses the {@link FactoryArgument} annotation on the DTO to find the factory method parameters.
*
* @param qualifier the qualifier annotation class.
* @return the next element of the DSL.
*/
T fromFactory(Class extends Annotation> qualifier);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy