public boolean isUniqueLabelTypeNameConstraint() {
if (!firstLevelValidationsPassed()) {
return true;
}
ILabelTypeDAO labelTypeDAO = Registry.getLabelTypeDAO();
if (isNewObject()) {
return !labelTypeDAO.existsByNameAnotherTransaction(this);
} else {
try {
LabelType c = labelTypeDAO
.findUniqueByNameAnotherTransaction(name);
return c.getId().equals(getId());
} catch (InstanceNotFoundException e) {
return true;
}