All Downloads are FREE. Search and download functionalities are using the official Maven repository.

poussecafe.doc.process.ComponentLinking Maven / Gradle / Ivy

There is a newer version: 0.29.0
Show newest version
package poussecafe.doc.process;

import poussecafe.doc.model.relation.Relation;
import poussecafe.doc.model.relation.RelationFactory;
import poussecafe.doc.model.relation.RelationFactory.NewRelationParameters;
import poussecafe.doc.model.relation.RelationRepository;
import poussecafe.process.DomainProcess;

public class ComponentLinking extends DomainProcess {

    public void linkComponents(NewRelationParameters parameters) {
        Relation relation = relationFactory.newRelation(parameters);
        if(relationRepository.find(relation.attributes().identifier().value()) == null) {
            runInTransaction(Relation.class, () -> relationRepository.add(relation));
        }
    }

    private RelationFactory relationFactory;

    private RelationRepository relationRepository;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy