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 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 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 = uc.id_company and uc.id_user = 'link' >> >> > The question is whether I can do this criterion with CreateAlias () or >> > CreateCriteria () traversing the graph.- Hide quoted text - >> >> - Show quoted text - > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---