private SoftwareModule getModuleAndThrowExceptionIfThatFails(final Long moduleId) { final SoftwareModule softwareModule = softwareModuleRepository.findOne(moduleId); if (softwareModule == null) { LOG.debug("no software module with ID {} exists", moduleId); throw new EntityNotFoundException("Software Module: " + moduleId); } return softwareModule; }
@Override @Modifying @Transactional(isolation = Isolation.READ_UNCOMMITTED) public void deleteArtifact(final Long id) { final JpaArtifact existing = localArtifactRepository.findOne(id); if (null == existing) { return; } clearArtifactBinary(existing); ((JpaSoftwareModule) existing.getSoftwareModule()).removeArtifact(existing); softwareModuleRepository.save((JpaSoftwareModule) existing.getSoftwareModule()); localArtifactRepository.delete(id); }