Inne Join no Hibernate? =(

Estou com um grande problema…
Quero executar essa query abaixo no hibernate:

select s.nm_student from teacher t inner join teacher_aux ta
on t.id_teacher=ta.id_teacher inner join class c
on ta.id_class=c.id_class inner join student s
on s.id_class=c.nm_class where t.id_teacher=2

Mas estou tendo problemas…

net.sf.hibernate.QueryException: in expected: ta [select s.nm_student from br.com.consa.profiles.entities.Teacher t inner join TeacherAux ta on t.id_teacher=ta.id_teacher inner join Class c on ta.id_class=c.id_class inner join Student s on s.id_class=c.nm_class where t.id_teacher=2]

será que alguem pode me ajudar???
:roll:

join se faz assim:

select s.nm_student
from teacher as t join t.teacher_aux as ta join ta.class as c …

tem q pensar em objeto… nao em relacionamento :slight_smile:

sendo q “teacher_aux” deve ser um atributo de teacher e “class” de teacher_aux (mapeados no bean eno xml)

Putz cara… sei q é um puta abuso… mas ainda não consegui fazer o Join!!! :cry:
Queria saber se vc poderia fazê-lo por inteiro. E tbm queria saber qual tag a mais tenho q colocar no meu XML.
To começando com o hibernate e nao conheço muito. Desde já mto obrigado!
Abraço!

fazer nao…
tu tem q apontar as classes, no xml

<many-to-one …

ou varias outras que tem, olha a documentacao.

boa sorte :wink: