Ayende @ Rahien

Refunds available at head office

The little query that could

It looks likes I still have a lot to learn about NHibernate, today I took a foray into criteria's projections, which are new and exciting to me, but what excites me right now is this little puppy. It is not that the query is terribly complicated, it is that this is traversing six tables as easily as it can be. From the Multi Query reference, you can probably understand why I am excited, I need to get ~6 results sets for this to work, and it is looking like this is going to be very easy to do it in a performant way.

(Image from clipboard).png

You have to realize, I am at the point when I am running passing tests in the debugger, just to check out how cool this is. In the time that it took me to write this post, I have implemented the bare bones of what is most probably the hardest part of the system. This particular functionality requires data from 30(!) tables. The final query is over 5Kb in size, and goes on for 3 pages. (I am talking about the final query, not the one above.)

And to forestall the obvious questions, yes, I use this color scheme sometimes, I amuses me.

Comments

Pete w
05/27/2007 07:28 PM by
Pete w

Dont let anyone make fun of your color scheme. I use almost the exact same colors on my VS, with the resharper bracket highlites.

Its been the default colors of vim since the early 90s (I bet)...

Ken Egozi
05/27/2007 08:17 PM by
Ken Egozi

I'd do that too if I've had the time to set it up. Maybe you can share the settings export file?

Scott
05/28/2007 03:38 AM by
Scott

Honestly, when I see more than 4 tables in a query, or a series of queries, I start thinking I need some views or UDFs in my database.

Ayende Rahien
05/28/2007 04:37 AM by
Ayende Rahien

Well, there are conceptually only two things in the query, customer and profile, the problem is that they are interconnected in interesting ways to the user, so basically this is a query for:

Give me the customers and profiles that are associated with the user, no matter how.

Comments have been closed on this topic.