Olá, a todos!!Estou tentando fazer uma consulta, para que os dados sejem inseridos na tabela está assim:
ClienteDao[code]
public List lista() {
ry{
lista= HibUtil.getSession().createQuery(“from Cliente order by nome”).list();
}catch( HibernateException ex){ex.printStackTrace();}
return lista;
}
[/code]
Populando jtable:
while(it.hasNext()){
Cliente cliente = (Cliente) it.next();
dtm.addRow(new Object[]{new JRadioButton (cliente.getId().toString()), cliente.getNome(), new RemMask().addCpf(cliente.getCpf()), new RemMask().addTel(cliente.getTelefone()), new RemMask().addTel(cliente.getCelular())});
No entando, a classe cliente, ela faz relacionamento com a classe cidade. Não sei se é por isso, mas retorna este erro:
[code]org.hibernate.PropertyAccessException: Exception occurred inside setter of svl.pojos.Cliente.cidade
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:65)
//////////////////////*
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
[/code]