Archive for August, 2008

Broke and happy, NHibernate 2.0 is out!

Monday, August 25th, 2008

Heh, sorry, the title is a bit misleading because although my cash reserves have been significantly drained by the purchase of a house, I am not broke.  But my code is, now that NH 2.0 has finally been released.  This finally means that I can start programming against solid production code.  However this release is not without its caveats.  NHibernate.Linq has been a project that I have been folowing quite closely and actually using.  Back around the time that Beta 2 of NH 2.0 was released, the NHibernate.Linq project was moved into the NHibernate.Contrib project and relatively quickly lapsed into obsolecence as it has not been able to be built against the releases for some time now.  I was hopefull that by the time 2.0 was actually released that NH.Linq would be caught up, but alas that was not the case.  The reason why is that there is  new, better, and refactored linq support on its way for NHibernate and is scheduled for the 2.1 version of NHibernate.  That’s great and all but it doesn’t really help poor schmoes like me who want to use the existing linq features for now.

Ok that’s enough whining for now, on to the fixing.  The main problem is that criteria queries have lost the property to spit out the name of the persitent class they are linked to.   Also some methods have been added to the ICriteria interface and some things have changed in the factory also to do with persistent class names.  Using my meager NHibernate skills I think I have worked around all these issues except for one (no more criteria comments) and if you are brave enough you can try the dll or apply the svn patch.  All of the tests ran fine for me, but I really havn’t had a chance to play around with it extensively.

This archive includes both a patch for applying to your NHibernate.Linq svn directory, and an NHibernate.Linq dll that is built against NHibernate 2.0GA.

Download at your own risk.

Riding out the bumps

Thursday, August 14th, 2008

Sometimes a person just has to wait for things to settle down before work can be done.  In this case I’m talking about NHibernate 2.0.  I had been building off of the latest stable release, beta 1, 2, CR1 etc…  However beta 2 seriously broke a bunch of things I’ve been working with as well as Linq support and I’m not sure yet what they intend on doing about it. For instance the latest stable release CR2, has added quite a few new methods to the ICriteria interface that is heavily used by both myself and Linq.  One would think that I could just add those methods into the classes that implement them and be done with it, however there is a further snag.  The latest SVN source of NHibernate (I would assume this is what NH 2.0 is being developed from) contains an ICriteria interface that is totally different than the one in CR2.  So which version is out of date and which one should I use?

Long story short, I’m going to have to wait a bit for the dust to settle before I can reliably continue building against NH 2.0.  Ahh but that’s the open source life.