HQL is far better suited for that query:
select count(*) from User u join Company c join Contract ct where
u.id='Link' and ct.id =10
The NH reference on NHForge.org has more on HQL and criteria queries.
-Markus
2009/10/22 Bruno Leitão de Oliveira uncod...@gmail.com
I have the following
Can i do it with CreateCriteria()?
CreateCriteria(Project, p);
CreateCriteria(P.Contract, pc);
...
On Oct 22, 4:45 am, Markus Zywitza markus.zywi...@gmail.com wrote:
HQL is far better suited for that query:
select count(*) from User u join Company c join Contract ct where
u.id='Link' and
Yes, it should work.
-Markus
2009/10/22 Bruno Leitão de Oliveira uncod...@gmail.com:
Can i do it with CreateCriteria()?
CreateCriteria(Project, p);
CreateCriteria(P.Contract, pc);
...
On Oct 22, 4:45 am, Markus Zywitza markus.zywi...@gmail.com wrote:
HQL is far better suited for that
I have the following case:
one User has many companies
one Company has many Users
one Contract has one Company
I need to know if the user 'link' belongs to the company contract with
code 10.
Something like:
count (1) from user_company uc, contract c where c.id = 10 and
c.id_company =