Zacatecnicky dotaz jak dostat do JPQL inner join on...

Petr Fejfar petr.fejfar na seznam.cz
Pondělí Září 21 09:29:33 CEST 2009


Ahoj,

potreboval bych postrcit, jak napsat JPQL:

* mam entitu AppUser s 1:M asociaci na entitu Subscription
   (V PostgreSQL to udelalo vazebni tabulku)
* mam entitu History

a potreboval bych z History vybrat vsechny zaznamy
pro daneho uzivatele s nejakou vlastnosti ze Subscription.

V SQL bych napsal takhle:

       select
         h.xxx,h.yyy,...
       from
         history as h
       inner join subscription s
         on h.vlastnost=s.vlastnost
       inner join basalwebuser_subscription l
         on s.id=l.subscriptions_id
       inner join basalwebuser u
         on u.id=l.basalwebuser_id
       where
         u.id=?
       order by ...


Pouzivam JPA+Hibernate. Jak mam dostat to
ON h.vlastnost=s.vlastnost do JPQL?


Diky, pf

 



Další informace o konferenci Konference