Question

Can i depend on NHibernate 3.0 built-in Linq provider to perform complex queries contain aggregate functions such as Max and Min and contains string operations such as Contains, StartsWith, or EndsWith ??

Was it helpful?

Solution

There has been much debate on the nhusers list as there are quite a few issues still outstanding.

I would look on the nhusers group and read some of the posts and make your own mind up. See here for posts.

Personally I have found that queryover does all that I need so I for one would wait until the Linq provider becomes more stable over time.

I would recommned in joining the nhusers group to get a better feel.

OTHER TIPS

The noticeable problems I found is:

  1. .OfType() method is not implemented that can be a problem with inheritance hierarchies.
  2. Left joins are not supported
  3. Non-trivial group by operations do not work (even something as simple as sorting by group count).
  4. Fetch() must be the last method in the query which can make paging with associated collections difficult.

However, it is definitely an improvement from the NHContrib provider.

The operations you listed are supported just fine in the usual scenarios.

The LINQ provider is far more stable and advanced than the one written by Ayende. (not dising what he wrote it was because of what he wrote that i picked up NH again)

I think the only issue I've come across with NH Query is composite types. You can do them in EF/L2S, and NH3 seems to generate the correct sql but fails to get to executing it.

Personally I like QueryOver, it reads better to me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top