}
@SuppressWarnings("unused")
@AssertTrue(message = "timesheet template name is already being used")
public boolean isUniqueWorkReportTypeNameConstraint() {
IWorkReportTypeDAO workReportTypeDAO = Registry.getWorkReportTypeDAO();
if (isNewObject()) {
return !workReportTypeDAO.existsByNameAnotherTransaction(this);
} else {
try {
WorkReportType c = workReportTypeDAO.findUniqueByName(name);
return c.getId().equals(getId());
} catch (InstanceNotFoundException e) {
return true;
} catch (NonUniqueResultException e) {
return false;