Help Busca hibernate  XML
Índice dos Fóruns » Persistência: Hibernate, JPA, JDBC e outros
Autor Mensagem
fabioebner
GUJ Ranger
[Avatar]

Membro desde: 10/06/2005 14:07:00
Mensagens: 822
Offline

Amigos estou com o seguinte problema: tenho 2 tabelas a tabela A e a B, a B e filha da A, entao para cada 1 registro na tabela A eu posso ter 1 ou mais na tabela B

Fiz o seguinte

A a = new A();
A.setCdCliente(objetoCliente);



hibernateTemplate.findByExample(A);


ele me retorna 2 itens da tabela A, porem eu so tenho 1 registro la, eu tenho 2 registros na tabela B, tem como eu retornar somente 1 registro?? (eu consegui porem eu tenho que criar uma criteria e setar o seguinte:


somente assmi que da pra fazer isso ou com o findByExample tbm tem como ?

valeu

 
Índice dos Fóruns » Persistência: Hibernate, JPA, JDBC e outros
Ir para:   
Powered by JForum 2.1.8 © JForum Team