private void loadJobPlanAssociatedEntities(DefaultJobPlan plan) { plan.setPlans(artifactPlanRepository.findByBuildId(plan.getJobId())); plan.setResources(resourceRepository.findByBuildId(plan.getJobId())); plan.setVariables( environmentVariableDao.load( plan.getJobId(), EnvironmentVariableSqlMapDao.EnvironmentVariableType.Job)); plan.setTriggerVariables( environmentVariableDao.load( plan.getPipelineId(), EnvironmentVariableSqlMapDao.EnvironmentVariableType.Trigger)); }
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()); }