IMaterialCategoryDAO materialCategoryDAO = Registry.getMaterialCategoryDAO();
return materialCategoryDAO.existsMaterialCategoryWithNameInAnotherTransaction(name);
}
private boolean isIfExistsTheExistentMaterialCategoryThisOne() {
IMaterialCategoryDAO materialCategoryDAO = Registry.getMaterialCategoryDAO();
try {
MaterialCategory materialCategory =
materialCategoryDAO.findUniqueByNameInAnotherTransaction(name);
return materialCategory.getId().equals(getId());
} catch (InstanceNotFoundException e) {
return true;
}
}