Difficulties with Logic

0

Well, the scenario is the following I am trying to develop an electronic point through my application, but I worked on the authentication logic of the following dates and working hours in the logic that I have at the moment it authenticates the date correctly but when it will authenticate the entry instead of authenticating the value on the same line ie using the same id it authenticates on another line it create a new record I hope someone can help me with this question follows the logic I'm developing.

List<Folha> findDateUser = folhaService.findByDateAndUser(data, usuario.getId());

    for (Folha listaCompleta : findDateUser) {

        if (listaCompleta.getData() == null) {

            listaCompleta.getIdFolha();
            listaCompleta.setData(data);
            listaCompleta.setUsuario(usuario);
            folhaDAO.persistir(listaCompleta);

        } else if (listaCompleta.getData() != null) {

            listaCompleta.getIdFolha();
            listaCompleta.setData(data);
            listaCompleta.setEntrada(entrada);
            listaCompleta.setUsuario(usuario);

            folhaDAO.update(listaCompleta);


        }
    }
    
asked by anonymous 04.04.2017 / 15:47

0 answers