Spring Framework ObjectRetrievalFailureException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ObjectRetrievalFailureException class.

This code example shows how to use the following methods:
                .add(org.hibernate.criterion.Restrictions.eq("clave", clave)) 
                .uniqueResult(); 
 
        if (emp == null) { 
            log.warn("uh oh, empleado with clave '" + clave + "' not found..."); 
            throw new ObjectRetrievalFailureException(Empleado.class, clave); 
        } 
 
        return emp; 
    } 
 
    @Override 
    public void actualiza(Empleado empleado) { 
        currentSession().update(empleado); 
        currentSession().flush(); 
    } 
} 
2
CodeRank
This code example shows how to use the following methods:
    @Override 
    public InformeProveedor obtiene(final Long id) { 
        InformeProveedor informeProveedor = (InformeProveedor) currentSession().get(InformeProveedor.class, id); 
        if (informeProveedor == null) { 
            log.warn("uh oh, Informe Proveedor with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(InformeProveedor.class, id); 
        } 
        return informeProveedor; 
    } 
 
    @Override 
    public void crea(final InformeProveedor informeProveedor, Usuario usuario) { 
        Session session = currentSession(); 
//        if (usuario != null) { 
//            informeProveedor.setEmpresa(usuario.getEmpresa()); 
//        } 
        currentSession().save(informeProveedor); 
        currentSession().merge(informeProveedor); 
        currentSession().flush(); 
    } 
3
CodeRank
This code example shows how to use the following methods:
     * @return a {@link java.io.InputStream} object. 
     */ 
    public InputStream returnErrorImage(String file) { 
        InputStream is =  getClass().getResourceAsStream(file); 
        if (is == null) { 
            throw new ObjectRetrievalFailureException(InputStream.class, file, "Could not find error image for '" + file + "' or could open", null); 
        } 
        return is; 
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public InputStream getPrefabGraph(String resourceId, String report, long start, long end, Integer width, Integer height) { 
        Assert.notNull(resourceId, "resourceId argument cannot be null"); 
        Assert.notNull(report, "report argument cannot be null"); 
        Assert.isTrue(end > start, "end time " + end + " must be after start time" + start); 
 
        PrefabGraphType t = m_graphDao.findPrefabGraphTypeByName("performance"); 
        if (t == null) { 
            throw new IllegalArgumentException("graph type \"" + "performance" 
3
CodeRank
This code example shows how to use the following methods:
    @Override 
    public InformeProveedorDetalle obtiene(final String nombreFactura) { 
        InformeProveedorDetalle proveedorDetalle = (InformeProveedorDetalle) currentSession().get(InformeProveedorDetalle.class, nombreFactura); 
        if (proveedorDetalle == null) { 
            log.warn("uh oh, Informe Empleado Detalle with id '" + nombreFactura + "' not found..."); 
            throw new ObjectRetrievalFailureException(InformeProveedorDetalle.class, nombreFactura); 
        } 
        return proveedorDetalle; 
    } 
 
    @Override 
    public void crea(final InformeProveedorDetalle proveedorDetalle, Usuario usuario) { 
        Session session = currentSession(); 
//        if (usuario != null) { 
//            proveedorDetalle.setEmpresa(usuario.getEmpresa()); 
//        } 
        currentSession().save(proveedorDetalle); 
        currentSession().merge(proveedorDetalle); 
        currentSession().flush(); 
    } 
3
CodeRank
This code example shows how to use the following methods:
    @Override 
    public ProveedorFacturas obtiene(final Long id) { 
        ProveedorFacturas proveedorFacturas = (ProveedorFacturas) currentSession().get(ProveedorFacturas.class, id); 
        if (proveedorFacturas == null) { 
            log.warn("uh oh, Proveedor with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(ProveedorFacturas.class, id); 
        } 
 
        return proveedorFacturas; 
    } 
 
    @Override 
    @Transactional(readOnly = true) 
    public ProveedorFacturas obtiene(String rfc) { 
        log.debug("obteniendo prveedor con rfc:{}", rfc); 
        ProveedorFacturas proveedorFacturas = (ProveedorFacturas) getSession() 
                .createCriteria(ProveedorFacturas.class) 
                .add(org.hibernate.criterion.Restrictions.eq("rfc", rfc)).uniqueResult(); 
 
        if (proveedorFacturas == null) { 
3
CodeRank
This code example shows how to use the following methods:
        ta.verifyAnticipated(); 
    } 
 
    public void testGetTopLevelResourceWithInvalidResourceType() { 
        ThrowableAnticipator ta = new ThrowableAnticipator(); 
        ta.anticipate(new ObjectRetrievalFailureException("Top-level resource type of 'bogus' is unknown", "bogus")); 
 
        m_easyMockUtils.replayAll(); 
        try { 
            m_resourceDao.getTopLevelResource("bogus", ""); 
        } catch (Throwable t) { 
            ta.throwableReceived(t); 
        } 
        m_easyMockUtils.verifyAll(); 
        ta.verifyAnticipated(); 
    } 
     
    public void testGetResourceDomainInterfaceExists() throws IOException { 
        File snmp = m_fileAnticipator.tempDir("snmp"); 
        File domain = m_fileAnticipator.tempDir(snmp, "example1"); 
3
CodeRank
This code example shows how to use the following methods:
    @Override 
    public InformeEmpleado obtiene(final Long id) { 
        InformeEmpleado informe = (InformeEmpleado) currentSession().get(InformeEmpleado.class, id); 
        if (informe == null) { 
            log.warn("uh oh, tipoBeca with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(InformeEmpleado.class, id); 
        } 
 
        return informe; 
    } 
 
    /** 
     * @see 
     * mx.edu.um.mateo.inscripciones.dao.InformeEmpleadoDao#crea(mx.edu.um.mateo.inscripciones.model.InformeEmpleado, 
     * mx.edu.um.mateo.general.model.Usuario) 
     */ 
    @Override 
    public void crea(final InformeEmpleado informe, Usuario usuario) { 
        Session session = currentSession(); 
        if (usuario != null) { 
3
CodeRank
This code example shows how to use the following methods:
    @Override 
    public AFEBecaAdicional obtiene(final Long id) { 
        AFEBecaAdicional becaAdicional = (AFEBecaAdicional) currentSession().get(AFEBecaAdicional.class, id); 
        if (becaAdicional == null) { 
            log.warn("uh oh, tipoBeca with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(AFEBecaAdicional.class, id); 
        } 
 
        return becaAdicional; 
    } 
 
    /** 
     * @see 
     * mx.edu.um.mateo.inscripciones.dao.AFEBecaAdicionalDao#crea(mx.edu.um.mateo.inscripciones.model.AFEBecaAdicional, 
     * mx.edu.um.mateo.general.model.Usuario) 
     */ 
    @Override 
    public void crea(final AFEBecaAdicional becaAdicional, Usuario usuario) { 
        Session session = currentSession(); 
        if (usuario != null) { 
3
CodeRank
This code example shows how to use the following methods:
    @Override 
    public Categoria obtiene(final Long id) { 
        Categoria categoria = (Categoria) currentSession().get(Categoria.class, id); 
        if (categoria == null) { 
            log.warn("uh oh, categoria with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(Categoria.class, id); 
        } 
 
        return categoria; 
    } 
 
    /** 
     *  @see mx.edu.um.mateo.rh.service.CategoriaManager#graba(mx.edu.um.mateo.rh.model.Categoria, mx.edu.um.mateo.general.model.Usuario)  
     */ 
    @Override 
    public void graba(final Categoria categoria, Usuario usuario) { 
        Session session = currentSession(); 
        if (usuario != null) { 
            categoria.setEmpresa(usuario.getEmpresa()); 
        } 
3
CodeRank
This code example shows how to use the following methods:
    @Override 
    public AFEPlaza obtiene(final Long id) { 
        AFEPlaza afePlaza = (AFEPlaza) currentSession().get(AFEPlaza.class, id); 
        if (afePlaza == null) { 
            log.warn("uh oh, AFE Plaza with id '" + id + "' not found..."); 
            throw new ObjectRetrievalFailureException(AFEPlaza.class, id); 
        } 
 
        return afePlaza; 
    } 
 
    @Override 
    public void crea(final AFEPlaza afePlaza, Usuario usuario) { 
        Session session = currentSession(); 
        if (usuario != null) { 
            afePlaza.setEmpresa(usuario.getEmpresa()); 
        } 
        afePlaza.setFechaAlta(new Date()); 
        afePlaza.setUsuarioAlta(usuario); 
        currentSession().save(afePlaza); 
3
CodeRank