-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Iterator
PostPosted: Mon Sep 03, 2012 10:35 am 
Newbie

Joined: Mon Sep 03, 2012 10:15 am
Posts: 1
Hola,Tengo definido dentro de la clase persistencia, un modulo para obtener una lista de objetos (getTareas) y en otra clase uso esa lista de objetos (Tareas). Necesito cargar un objeto desde una lista y no se si mi problema esta en la definición del modulo de obtención de la lista o si esta en algun otro lugar.
--------------------------------------------
package Persistencia;

public class persistencia {
private SessionFactory sessionFactory;
private Session session;
/*
Tengo todas las clases definidas
*/
public List getTareas() throws ArrayStoreException{
List items= new ArrayList();
Transaction tx = session.beginTransaction();
items= session.createSQLQuery("select * from tareas").list();
tx.commit();
return items;
}
----------------------------------------
package Presentacion;

public class JFrameActividades extends javax.swing.JFrame {
private Controlador Drive;
private String Nombre;
private Date Horainicio;

public Tarea tarea = new Tarea();
public Colegio colegio = new Colegio();
/*
Defino todas las propiedades get's and set's
*/

private void CargarGrilla() {
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();

List<Tarea> tareas = Drive.getPERSISTENCIA().getTareas();

int a = 0;

Iterator it = tareas.iterator();

while (it.hasNext()) {
Object[] fila = new Object[3];

Tarea tar=(Tarea) it.next(); //NO ME CARGA EL OBJETO CONTENIDO EN it.next EN tar

a++;
}
Table1.setModel(model);
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.