@Override
@Transactional(readOnly = true)
public CalendarExceptionType findUniqueByName(String name) throws InstanceNotFoundException {
if (StringUtils.isBlank(name)) {
throw new InstanceNotFoundException(null, CalendarExceptionType.class.getName());
}
CalendarExceptionType calendarExceptionType = (CalendarExceptionType) getSession().createCriteria(
CalendarExceptionType.class).add(
Restrictions.eq("name", name.trim()).ignoreCase())
.uniqueResult();
if (calendarExceptionType == null) {
throw new InstanceNotFoundException(name, CalendarExceptionType.class.getName());
} else {
return calendarExceptionType;
}
}