Beispiel #1
0
 public void validateUniqueness(List<ArtifactPlan> existingPlans) {
   for (ArtifactPlan existingPlan : existingPlans) {
     if (this.equals(existingPlan)) {
       this.addUniquenessViolationError();
       existingPlan.addUniquenessViolationError();
       return;
     }
   }
   existingPlans.add(this);
 }
Beispiel #2
0
 public void save(long jobId, JobPlan plan) {
   for (Resource resource : plan.getResources()) {
     resource.setBuildId(jobId);
     resourceRepository.save(resource);
   }
   for (ArtifactPropertiesGenerator generator : plan.getPropertyGenerators()) {
     generator.setJobId(jobId);
     getSqlMapClientTemplate().insert("insertArtifactPropertiesGenerator", generator);
   }
   for (ArtifactPlan artifactPlan : plan.getArtifactPlans()) {
     artifactPlan.setBuildId(jobId);
     artifactPlanRepository.save(artifactPlan);
   }
   environmentVariableDao.save(
       jobId, EnvironmentVariableSqlMapDao.EnvironmentVariableType.Job, plan.getVariables());
 }