package org.jboss.da.bc.backend.impl;

import org.jboss.da.bc.backend.api.BCSetGenerator;
import org.jboss.da.bc.model.BuildConfigurationSet;
import org.jboss.da.communication.pnc.api.PNCConnector;

import javax.inject.Inject;

import java.util.List;

public class BCSetGeneratorImpl implements BCSetGenerator {

    @Inject
    private PNCConnector pnc;

    public BuildConfigurationSet createBCSet(String name, Integer productVersionId,
            List<Integer> bcIds) {
        BuildConfigurationSet bcSet = toBCSet(pnc
                .findBuildConfigurationSet(productVersionId, bcIds));
        if (bcSet == null) {
            bcSet = new BuildConfigurationSet();
            bcSet.setBuildConfigurationIds(bcIds);
            bcSet.setName(name);
            bcSet.setProductVersionId(productVersionId);
        }
        return bcSet;
    }

    private BuildConfigurationSet toBCSet(
            org.jboss.da.communication.pnc.model.BuildConfigurationSet pncBCSet) {
        if (pncBCSet == null)
            return null;
        BuildConfigurationSet bcSet = new BuildConfigurationSet();
        bcSet.setId(pncBCSet.getId());
        bcSet.setName(pncBCSet.getName());
        bcSet.setProductVersionId(pncBCSet.getProductVersionId());
        bcSet.setBuildConfigurationIds(pncBCSet.getBuildConfigurationIds());
        return bcSet;
    }

}

@@ -192,16 +192,67 @@
 ector;%0A%0A
+import javax.enterprise.context.ApplicationScoped;%0A
 import j
@@ -296,16 +296,35 @@
 .List;%0A%0A
+@ApplicationScoped%0A
 public c

Add forgotten annotation