For the adventerous sort: Active Record + NHibernate 1.2

time to read 3 min | 499 words

I branched Active Record to move it to NHibernate 1.2, because of some needed features from NHibernate 1.2 that simply do not exist in NHibernate 1.0.2. The branch at the moment should handle generics natively and easily, so you should be able to do this:

[

HasMany]
public ISet<Post> Posts { ... }

And Active Record would figure out all the rest. (Although it is probably recommended to give it at least the table / column for the relation).

But, as much as I like features that include "someone else will figure it out", the nicest feature of all is this one:

ProjectionQuery<Blog, int> proj = new ProjectionQuery<Blog, int>(Projections.RowCount());

int rowCount = proj.Execute();

Assert.AreEqual(1, rowCount);

This one involves taking advantage on NHibernate 1.2 projections, and it makes certain types of action possible, the above query can also take an ICriteria, which make it a very easy way to handle what previously required HQL to do. There are a large number of builtin projections that can be used, and I found uses for them about 5 minutes after seeing them in action.