Code example for ObjectRetrievalFailureException

0
    @Override 
    public EmpleadoPerDed obtiene(Long id) { 
        EmpleadoPerDed perded = (EmpleadoPerDed) currentSession().get(EmpleadoPerDed.class, id); 
        if (perded == null) { 
            log.warn("uh oh, EmpleadoPD with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(EmpleadoPerDed.class, id); 
        } 
 
        return perded; 
    } 
 
    /** 
     * @see mx.edu.um.mateo.rh.dao.EmpleadoPerDedDao#graba(mx.edu.um.mateo.rh.model.EmpleadoPerDed)  
     */ 
    @Override 
    public EmpleadoPerDed graba(EmpleadoPerDed empleadoPD) { 
        currentSession().saveOrUpdate(empleadoPD); 
        currentSession().merge(empleadoPD); 
        currentSession().flush(); 
         
Contextual code suggestions in your IDE  Get Codota for Java