Querying aggregate object in NHibernate/Hibernate?

Should be pretty simple if you use the lambda extensions to ICriteria.

Should be pretty simple if you use the lambda extensions to ICriteria: session.CreateCriteria(). Add(s=>s.Country. NameEn == "United States").List(); This ought to add the proper join and equality constraint, as long as the two entities' relationship is properly mapped in your HBMs.

Also, try Linq2NH with the NLinq namespace: session.Linq(). Where(s=>s.Country. NameEn == "United States").ToList(); I'm setting up Linq queries as you read this that go a couple layers deeper; no sweat at all.

Thank you for your fast answer but I end up with the following error :Cannot convert lambda expression to type 'NCriterion. ICriterion' because it is not a delegate type – Guillaume Raymond Dec 7 '10 at 21:36 You have to use the Nbernate Lambda Extensions, which is an add-on to the core N You can get it at code.google. Com/p/nhlambdaextensions.

I would recommend Linq 2 N personally, as the entire NH Criteria model is already a generation behind. – KeithS Dec 7 '10 at 23:22 Thanks for your time Keith! I'm gonna check for Linq2 Nbernate tomorrow morning!

– Guillaume Raymond Dec 8 '10 at 2:58.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions