Co neco ve stylu from Cat as cat left join cat.kittens as kitten with kitten.bodyWeight > 10.0
Tom > -----Original Message----- > From: konference-boun...@java.cz > [mailto:konference-boun...@java.cz] On Behalf Of Petr Prikryl > Sent: Tuesday, July 13, 2010 3:05 PM > To: Java > Subject: Re: HQL syntax: select p is null from Pacient p > > ne, ne > > cilem je vytahnout objek pacient a k nemu jeste zda ma > provedene vysetreni aniz bych tahal komplet obrovsky objekt vysetreni. > > Bohuzel to se mi nedari tak jsem jako prvni priklad uvedl to > nejjednodussi > > select p is null from Pacient p > > > pokud by tohle fungovalo pote jsem chtel vyzkouset > > select p, p.vystreni is null from Pacient p > > > a pokud by toto slo pak bych psal > > select p, p.vstupni_vystreni.provedeno == null, > p.vvystupni_vystreni.provedeno == null ,... from ...; > > > Avsak se nedokazu prokousat ani pres ten 1. a tudiz ostatni > taky nefunguji. > > sql ekvivalent od oka je > > select p*, v.provedeno eq NULL from pacient p natural join > vysetreni v; > > > Diky > PP > > > On 07/13/2010 02:36 PM, Oto Buchta wrote: > > A to ma byt SQL eqivalent k necemu jako select * from Pacient where > > vystupni_vystreni is null ??? > > > > Pak je samozrejme potreba pouzit WHERE klausuli... > > > > Dne 13. Ĩervence 2010 14:30 Petr > Prikryl<peter.prik...@gmail.com> napsal(a): > > > >> Dobry den uz se 2 dny morim s 1 HQL dotazem. > >> > >> select p is null from Pacient p > >> zpusobi > >> Caused by: org.hibernate.QueryException: , expected in > SELECT [select > >> p is null from cz.admin24.evidencePacientu.entity.Pacient p] > >> at > >> org.hibernate.hql.classic.SelectParser.token(SelectParser.java:175) > >> at > >> org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:86) > >> > >> > >> At zkousim dat mist is null =, == > >> nic nepomaha > >> > >> select p from Pacient p > >> funguje > >> > >> a proc to chci? > >> protoze potrebuji pro view udelat prehledovou tabulku ktera bude > >> pouzivat cca takove HQL > >> > >> > >> > > >> Jak se to pise spravne > >> podle BNF by ta syntax mela byt podporovana.. > >> > http://www.finesight.com/hibernate-3.2.5/other/hql-bnf.html#se > lectObject . > >> Diky > >> PP > >> > >> -- > >> Petr Prikryl > >> ----------------------- > >> petrprik...@centrum.cz > >> prik...@admin24.cz > >> www.admin24.cz > >> > >> > >> > > > > > > > > > -- > Petr Prikryl > ----------------------- > petrprik...@centrum.cz > prik...@admin24.cz > www.admin24.cz > >