use of uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationResult in project miso-lims by miso-lims.
the class DefaultSampleTypeService method validateDeletion.
@Override
public ValidationResult validateDeletion(SampleType object) throws IOException {
ValidationResult result = new ValidationResult();
long usage = sampleTypeDao.getUsage(object);
if (usage > 0L) {
result.addError(ValidationError.forDeletionUsage(object, usage, Pluralizer.samples(usage)));
}
return result;
}
use of uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationResult in project miso-lims by miso-lims.
the class DefaultSequencingContainerModelService method validateDeletion.
@Override
public ValidationResult validateDeletion(SequencingContainerModel object) throws IOException {
ValidationResult result = new ValidationResult();
long usage = containerModelDao.getUsage(object);
if (usage > 0) {
result.addError(ValidationError.forDeletionUsage(object, usage, "sequencing " + Pluralizer.containers(usage)));
}
return result;
}
use of uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationResult in project miso-lims by miso-lims.
the class DefaultSampleClassService method validateDeletion.
@Override
public ValidationResult validateDeletion(SampleClass object) throws IOException {
ValidationResult result = new ValidationResult();
long usage = sampleClassDao.getUsage(object);
if (usage > 0L) {
result.addError(ValidationError.forDeletionUsage(object, usage, Pluralizer.samples(usage)));
}
return result;
}
use of uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationResult in project miso-lims by miso-lims.
the class DefaultWorksetCategoryService method validateDeletion.
@Override
public ValidationResult validateDeletion(WorksetCategory object) throws IOException {
ValidationResult result = new ValidationResult();
long usage = worksetCategoryDao.getUsage(object);
if (usage > 0L) {
result.addError(ValidationError.forDeletionUsage(object, usage, Pluralizer.worksets(usage)));
}
return result;
}
use of uk.ac.bbsrc.tgac.miso.core.service.exception.ValidationResult in project miso-lims by miso-lims.
the class DefaultWorksetStageService method validateDeletion.
@Override
public ValidationResult validateDeletion(WorksetStage object) throws IOException {
ValidationResult result = new ValidationResult();
long usage = worksetStageDao.getUsage(object);
if (usage > 0L) {
result.addError(ValidationError.forDeletionUsage(object, usage, Pluralizer.worksets(usage)));
}
return result;
}
Aggregations