replace HibernateObjectRetrievalException with null checks and EntityNotFoundException