}
@SuppressWarnings("unused")
@AssertTrue(message = "Quality form name is already being used")
public boolean isUniqueQualityFormNameConstraint() {
IQualityFormDAO qualityFormDAO = Registry.getQualityFormDAO();
if (isNewObject()) {
return !qualityFormDAO.existsByNameAnotherTransaction(this);
} else {
try {
QualityForm c = qualityFormDAO.findUniqueByName(name);
return c.getId().equals(getId());
} catch (InstanceNotFoundException e) {
return true;
} catch (NonUniqueResultException e) {
return false;