| Author |
Hibernate many-to-many error
|
Wagner Danda Da Silva Filho
Ranch Hand
Joined: Mar 21, 2003
Posts: 80
|
|
Hi All, I'm having trouble to query a many-to-many association with Hibernate. Here are the envolved hbm files: Here are the classes: Here is the Criteria I'm trying to create: Here is the output: I could see that Hibernate is doing a SELECT in the wrong table! The many-to-many table is "PACP_PACOTE_PLANO", and the select is reading from "PACM_PACOTE_MINUTOS"... What am I doing wrong?  [ September 09, 2005: Message edited by: Wagner da Silva ]
|
SCJP, SCWCD
|
 |
Wagner Danda Da Silva Filho
Ranch Hand
Joined: Mar 21, 2003
Posts: 80
|
|
Hey, I found a stupid yet simple solution: First I get a "PlanoFaturamento" object loaded from my DAO, e.g.: Then I can simply call: This executes the correct query and gives me a Collection of "PacoteMinutos".
|
 |
 |
|
|
subject: Hibernate many-to-many error
|
|
|