I just do this and Hibernate (2.0.3) generated the folow SQLs:
Code:
Hibernate: select projeto0_.cdProjeto as cdProjeto0_, sistemas1_.cdProjeto as cdProjeto1_, sistemas1_.cdSistema as cdSistema1_, projeto0_.nmProjeto as nmProjeto0_, projeto0_.sgProjeto as sgProjeto0_, projeto0_.deBasevss as deBasevss0_, sistemas1_.nmSistema as nmSistema1_, sistemas1_.sgSistema as sgSistema1_, sistemas1_.deHomedigital as deHomedi5_1_, sistemas1_.cdProjeto as cdProjeto__, sistemas1_.cdSistema as cdSistema__ from SAC.ESACPROJETO projeto0_ left outer join SAC.ESACSISTEMA sistemas1_ on projeto0_.cdProjeto=sistemas1_.cdProjeto where (projeto0_.cdProjeto=1 )
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
Hibernate: select sistema0_.cdProjeto as cdProjeto, sistema0_.cdSistema as cdSistema, sistema0_.nmSistema as nmSistema, sistema0_.sgSistema as sgSistema, sistema0_.deHomedigital as deHomedi5_ from SAC.ESACSISTEMA sistema0_ where sistema0_.cdProjeto=? and sistema0_.cdSistema=?
And the result was eight rows:
[code]1. (Projeto:1;PD;[(Sistema:1;1;SAC)])
2. (Projeto:1;PD;[(Sistema:1;2;SP4/SIA)])
3. (Projeto:1;PD;[(Sistema:1;3;SPW)])
4. (Projeto:1;PD;[(Sistema:1;4;Fon