Package entidades

Examples of entidades.Condena


            public void actionPerformed(ActionEvent e) {
                try {
                    validarDatos();
                    if (JOptionPane.showConfirmDialog(CondenaController.this, "Desea Guardar?", "Condena", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
                        Preso p;                   
                        Condena condena = new Condena();
                       
                        condena.setFechaCreacion(fechaDateChooser.getDate());
                        condena.setJuez(String.valueOf(juezField.getText()));
                        condena.setFechaHasta(fechaHastaDateChooser.getDate());
                       
                        Integer nro = Integer.valueOf(nroPresoField.getText());
                        p = (Preso) ec.createQuery("select p from Preso p where p.nroPreso = :nro", Preso.class).setParameter("nro", nro).getSingleResult();
                        condena.setPreso(p);
                       
                        ec.persist(condena, false);
                        for (int i = 0; i < agregados.size(); i++) {
                            MotivosDelPreso motivo = agregados.get(i);
                            if (motivo.getPreso().getNropreso() == condena.getPreso().getNropreso()) {
                                motivo.setCondena(condena);
                                ec.updateEntity(motivo, false);
                            }
                        }
                        TipoEstadoPreso tep = (TipoEstadoPreso) ec.createQuery("select t from TipoEstadoPreso t where t.descripcion = 'Condenado'", TipoEstadoPreso.class).getSingleResult();
View Full Code Here

TOP

Related Classes of entidades.Condena

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.