NHibernate.FlowQuery v1.2 Released

There hasn’t been too many updates here the last two years so I thought it would be about time I said “Hi, I’m alive!”.
I’ve just uploaded a new version of NHibernate.FlowQuery ( FlowQuery ). Version 1.2 of FlowQuery can be downloaded here. The new version is built against NHibernate 3.3.2.

This release adds overloads for the *Join-methods on ISubFlowQuery giving you the possibility to specify extra onClause-criteria there as well as you have been able to do on the regular IFlowQuery for quite some time now. I have also added a short hand to IFlowQuery called Any() with a few overloads for specifying conditions. The methods works pretty much the same as the Any() method in the Linq API.

Example of Any() using:

bool anyUserOnline = Query<User>()
    .Any(u => u.IsOnline);

How to solve the above with previous version:

bool anyUserOnline = Query<User>()
    .Where(u => u.IsOnline)
    .Take(1)
    .Count() > 0;

As you can see, this gives you a little less to write in these occasions. I hope it’ll come in handy.

Enjoy! (:

/Niklas Källander

NHibernate.FlowQuery v0.9 Released

Just uploaded a new version of NHibernate.FlowQuery ( FlowQuery ). Version 0.9 of FlowQuery can be downloaded here. The new version is built against both NHibernate 2.1.2 and NHibernate 3.1.0. Both builds contains several minor bug fixes and small improvements to the joining API. The build against NHibernate 3.1.0 however also contains overloads for all Join methods that takes a parameter specifying extra on-clause criteria.

Example:

UserGroupLink link = null;

var activeGroupIds = Query<User>()
    .Join(u => u.Groups, () => link, u => link.IsActive)
    .Select(u => link.Group.Id);

The above Join-call will translate into something like this ( in the ICriteria API ):

criteria.CreateAlias("Groups", "link", JoinType.InnerJoin, Restrictions.Eq("link.IsActive", true));

That’s about it for now.

Enjoy! (:

/Niklas Källander