NHibernate.Linq Alpha Released

80 views
Skip to first unread message

Chad Lee

unread,
Jan 15, 2009, 4:53:26 PM1/15/09
to nhc...@googlegroups.com, nhu...@googlegroups.com
NHibernate.Linq is a Linq provider for NHibernate 2.0.1 GA.  It processes Linq expressions using NHibernate's Criteria API.  This release is meant as a stopgap release pending an implementation not reliant on the Criteria API.  Most queries are supported with the exception of the following:
  • Group Joins
  • Subqueries in select clause
For a more complete list of unsupported queries, you can look at the skipped test cases in the source distribution.

Any feedback can be sent to the NHibernate user group (http://groups.google.com/group/nhusers).  Issues can be submitted to http://jira.nhibernate.org/.  Please go to http://sourceforge.net/project/showfiles.php?group_id=216446&package_id=306405&release_id=654054 to download.

reach4thelasers

unread,
Jan 15, 2009, 7:43:08 PM1/15/09
to nhusers
Hi Chad,

do you know if its possible to get this to work with the NH trunk? or
is it impossible? I tried compiling a version against it last week
but I had a lot of bother getting things to work. Is there any strict
technical reason why it shouldn't work?

thanks,

Kev

On Jan 15, 9:53 pm, Chad Lee <chadl...@gmail.com> wrote:
> NHibernate.Linq is a Linq provider for NHibernate 2.0.1 GA.  It processes
> Linq expressions using NHibernate's Criteria API.  This release is meant as
> a stopgap release pending an implementation not reliant on the Criteria
> API.  Most queries are supported with the exception of the following:
>
>    - Group Joins
>    - Subqueries in select clause
>
> For a more complete list of unsupported queries, you can look at the skipped
> test cases in the source distribution.
>
> Any feedback can be sent to the NHibernate user group (http://groups.google.com/group/nhusers).  Issues can be submitted tohttp://jira.nhibernate.org/.  Please go tohttp://sourceforge.net/project/showfiles.php?group_id=216446&package_...
> download.

Colin Jack

unread,
Jan 16, 2009, 9:32:33 AM1/16/09
to nhusers
Great work, looking forward to trying out newest version.

On Jan 15, 9:53 pm, Chad Lee <chadl...@gmail.com> wrote:
> NHibernate.Linq is a Linq provider for NHibernate 2.0.1 GA.  It processes
> Linq expressions using NHibernate's Criteria API.  This release is meant as
> a stopgap release pending an implementation not reliant on the Criteria
> API.  Most queries are supported with the exception of the following:
>
>    - Group Joins
>    - Subqueries in select clause
>
> For a more complete list of unsupported queries, you can look at the skipped
> test cases in the source distribution.
>

Chadly

unread,
Jan 16, 2009, 10:14:42 AM1/16/09
to nhusers
NH.Linq was working with the trunk up until the previous revision. It
was necessary to compile against NH GA for release. If you want to
build NH.Linq from the NH trunk, you can just update to r695 of
NHContrib which is the previous revision of NH.Linq which compiles
against trunk.

On Jan 15, 6:43 pm, reach4thelasers <kev.m.mul...@googlemail.com>
wrote:

reach4thelasers

unread,
Jan 16, 2009, 10:30:01 AM1/16/09
to nhusers
Great! Thanks!! Awesome work on the release!

Ed C.

unread,
Jan 16, 2009, 4:31:59 PM1/16/09
to nhusers
How does this compare to the NH LINQ provider from http://slagd.com/?p=21
?


On Jan 15, 4:53 pm, Chad Lee <chadl...@gmail.com> wrote:
> NHibernate.Linq is a Linq provider for NHibernate 2.0.1 GA.  It processes
> Linq expressions using NHibernate's Criteria API.  This release is meant as
> a stopgap release pending an implementation not reliant on the Criteria
> API.  Most queries are supported with the exception of the following:
>
>    - Group Joins
>    - Subqueries in select clause
>
> For a more complete list of unsupported queries, you can look at the skipped
> test cases in the source distribution.
>

Nicao

unread,
Jan 19, 2009, 7:41:19 PM1/19/09
to nhusers
@ Ed C.
Definitely go with this provider instead. The version I posted at
slagd was just a quick patch so users could keep using linq. This one
is more mature.

On Jan 16, 2:31 pm, "Ed C." <defeated...@gmail.com> wrote:
> How does this compare to the NH LINQ provider fromhttp://slagd.com/?p=21

Colin Jack

unread,
Jan 20, 2009, 12:36:41 PM1/20/09
to nhusers
I've just gotten r695 but when I try to build NHibernate.Linq I get
two errors:

Error 1 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'NHibernate.ICriteria.Future<T>()' C:
\Projects\stack\NHibernateCOntrib\trunk\src\NHibernate.Linq\src
\NHibernate.Linq\Util\DetachedCriteriaAdapter.cs 19 15 NHibernate.Linq
Error 2 The type or namespace name 'Dynamic' does not exist in the
namespace 'System.Linq' (are you missing an assembly reference?) C:
\Projects\stack\NHibernateCOntrib\trunk\src\NHibernate.Linq\src
\NHibernate.Linq.Tests\DynamicQueryTests.cs 3 19 NHibernate.Linq.Tests

Any ideas?

Colin Jack

unread,
Jan 21, 2009, 3:58:27 AM1/21/09
to nhusers
Sorry to post again but when I upgrade to the current version of
NHibernate Contrib the errors I get when building against the latest
version of NHibernate from the trunk are:

Error 1 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'System.ICloneable.Clone()' C:\Projects
\stack\NHibernateCOntrib\trunk\src\NHibernate.Linq\src\NHibernate.Linq
\Util\DetachedCriteriaAdapter.cs 19 15 NHibernate.Linq
Error 2 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member
'NHibernate.ICriteria.GetRootEntityTypeIfAvailable()' C:\Projects\stack
\NHibernateCOntrib\trunk\src\NHibernate.Linq\src\NHibernate.Linq\Util
\DetachedCriteriaAdapter.cs 19 15 NHibernate.Linq
Error 3 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'NHibernate.ICriteria.ClearOrders()' C:
\Projects\stack\NHibernateCOntrib\trunk\src\NHibernate.Linq\src
\NHibernate.Linq\Util\DetachedCriteriaAdapter.cs 19 15 NHibernate.Linq
Error 4 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'NHibernate.ICriteria.Future<T>()' C:
\Projects\stack\NHibernateCOntrib\trunk\src\NHibernate.Linq\src
\NHibernate.Linq\Util\DetachedCriteriaAdapter.cs 19 15 NHibernate.Linq
Error 5 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'NHibernate.ICriteria.SetFlushMode
(NHibernate.FlushMode)' C:\Projects\stack\NHibernateCOntrib\trunk\src
\NHibernate.Linq\src\NHibernate.Linq\Util\DetachedCriteriaAdapter.cs
19 15 NHibernate.Linq
Error 6 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'NHibernate.ICriteria.SetComment(string)' C:
\Projects\stack\NHibernateCOntrib\trunk\src\NHibernate.Linq\src
\NHibernate.Linq\Util\DetachedCriteriaAdapter.cs 19 15 NHibernate.Linq
Error 7 'NHibernate.Linq.Util.DetachedCriteriaAdapter' does not
implement interface member 'NHibernate.ICriteria.SetFetchSize(int)' C:

Tuna Toksoz

unread,
Jan 21, 2009, 4:36:49 AM1/21/09
to nhu...@googlegroups.com
rev695 made it work against current trunk, except the fact that Future<T> implementation for ICriteria. I implemented it and throw an exception, then it built.


Tuna Toksöz
http://tunatoksoz.com

Typos included to enhance the readers attention!

Drew

unread,
Mar 11, 2009, 6:14:12 PM3/11/09
to nhusers
Greetings all,

I realize this is something of a silly question (an alpha is an alpha,
right?) but is this release usable for production? I recently joined
an enterprise-scale project and am evaluating ORM implementations,
with NHibernate and Entity Framework on the short-list. To give me my
first experience with NHibernate to best evaluate it I'd like to
implement a very small production project using NHibernate.Linq. (A
simple web service to be used by external entities meaning we don't
want to be embarrassed by breakage.) Current best estimate is to
implement the very small project within a month, a medium project by
the middle of July, and everything else in an 8-16 month time frame.

Will NH.Linq be up to heavy-duty use in this time frame?

Research into the Entity Framework indicates the desired feature set
won't be available until at least after upcoming 2010 release, and
frankly we can't wait that long. I'm hoping NHibernate can provide
what we're looking for in a timelier manner?

Any thoughts, suggestions, or comments regarding the situation? If
you've used it what has your experience been with NH.Linq?

Thanks so much for your help!

Drew

On Jan 15, 2:53 pm, Chad Lee <chadl...@gmail.com> wrote:
> NHibernate.Linq is a Linq provider for NHibernate 2.0.1 GA.  It processes
> Linq expressions using NHibernate's Criteria API.  This release is meant as
> a stopgap release pending an implementation not reliant on the Criteria
> API.  Most queries are supported with the exception of the following:
>
>    - Group Joins
>    - Subqueries in select clause
>
> For a more complete list of unsupported queries, you can look at the skipped
> test cases in the source distribution.
>

Graham Bunce

unread,
Mar 12, 2009, 12:22:11 PM3/12/09
to nhusers
Personally, I'd design my app to take account of the Alpha nature. If
EF isn't going to be ready then you don't have a lot of choice. No
other freeware solution comes close to NH in my opinion.

In our company I've designed the apps so I have a formal repository
that implements an interface in the domain later. This interface
defines that has methods you can call but the repository implements
them. This reverse dependency is wired together via an IoC product
such as Spring.NET or Unity.

Therefore I have a choice in the repository how I implement the method
- I can use Linq-NH, which works in 70-80% of cases or, where it gets
complicated I can shift to HQL. The domain layer doesn't care how the
repository does it.

Although it isn't "pure" and I don't really like it, I do expose a an
IQuerable<T> Query property in the repository for those simple ad-hoc
queries that Linq excels at, so I don't need a special method for
every single simple thing I need to do.

I also make sure my developers know Linq-NH isn't a fully featured
Linq implementation (e.g. I can't get it to do joins) but as least I
have an architecutre in place to work around any issues that crop up.

I also have an architecure to swap to EF if I need to in 2010 / 2012
but I expect with NH 3.0 Linq will be fully featured and I won't
really need to.

Drew

unread,
Mar 12, 2009, 2:08:40 PM3/12/09
to nhusers
That sounds like fantastic advice, I think I'll try just that.

Thank you!!!

Drew Loika

Graham Bunce

unread,
Mar 12, 2009, 8:07:52 PM3/12/09
to nhusers
Good luck, NH is a great product but its a big learning curve from
scratch. My first experience of it was sorting out another (fired)
architects mistakes so I've been through the fire with it.

Look at Jimmy Nielson - Domain Driven Design; a good book that really
makes you think about persistence ignorance. If you enforce neutrality
in the domain layer (i.e. be ultra strict about not allowing NH to
bleed into it) then you keep your options open for the future. IMO
anyway.
Reply all
Reply to author
Forward
0 new messages