@Override
public <E extends IEntity> E findEntity(Criteria<E> criteria) throws InvalidCriteriaException,
EntityNotFoundException, NonUniqueResultException, DataAccessException {
final List<E> list = findEntities(criteria, null);
if(list == null || list.size() < 1) {
throw new EntityNotFoundException("No matching entity found.");
}
else if(list.size() > 1) {
throw new NonUniqueResultException("More than one matching entity found.");
}
assert list.size() == 1;