Code example for ObjectRetrievalFailureException

0
    @Override 
    public Institucion obtiene(final Long id) { 
        Institucion institucion = (Institucion) currentSession().get(Institucion.class, id); 
        if (institucion == null) { 
            log.warn("uh oh, institucion with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(Institucion.class, id); 
        } 
 
        return institucion; 
    } 
     
    @Override 
    public void graba(Institucion institucion) { 
        Session session = currentSession(); 
        
        currentSession().saveOrUpdate(institucion); 
        currentSession().merge(institucion); 
        currentSession().flush(); 
        } 
     
Experience pair programming with AI  Get Codota for Java