views:

158

answers:

1

I am using the latest nHibernate.Linq 2.1.2. But if I use join in my linq query I will get run time error "The method Join is not implemented".

Could someone tell me if join is supported by nHibernate.Linq and if it is supported what is the cause of this error?

+2  A: 

Doesn't look like Joins are supported in the current version of Linq to Hibernate.

See post from Adam Aldrich's Blog here

I worked around it using two linq quiries within my session. The first one selected from the one table and the second from the second table using the values of the first result to constrain my query. Not as efficient as a Join, but since the data I was using was minimal, it worked fine.

You could also try using the Criteria API or HQL.

Dion
Tnx Dion. I've seen that page. But how about this page http://blogs.imeta.co.uk/sstrong/archive/2009/12/16/823.aspx. Here there are examples for join and I it dates back to Dec 2009 when 2.1.2 is released. Any ideas?
kaptan
The same link in nhforge http://nhforge.org/blogs/nhibernate/archive/2009/12/16/linq-to-nhibernate-progress-report-a-christmas-gift.aspx
kaptan
Ok, I think I got the point. We cannot "join across entities that are NOT related".
kaptan