November 2007 - Posts

Custom Tool Configuration I've been using Ayende's NHibernate Query Generator (NHQG) to help type-ify my NHibernate repository queries.  One of the great +1's of his tool is that you can apply it as a Custom Tool for your NHibernate mapping files right within Visual Studio.  

With this setup, every change to my mapping file is reflected in my typed NHibernate ICriteria instances.  For those who work directly with Hibernate Expressions, look how clean my queries are:

// Get it using the Id
public static MyClass GetById(long id)
{
return Repository.Get<MyClass>(Where.MyClass.Id == id);
}
// Get those updated today
public void Example2()
{
IList<MyClass> cards = Repository.Find<MyClass>(Where.MyClass.LastUpdated >= DateTime.Today);
}

That's just awesome!

There's a slight glitch though, his installer only registers the tool for Visual Studio 2005.  I'm sure now that 2008 is RTM (I've been using Beta 2) he'll soon have a new version out, but in the mean time, you can use these two .reg files:

NHQG C# Custom Tool Registration

NHQG VB Custom Tool Registration

with 5 comment(s)
Filed under:

SRCardHere at Speedway our Speedy Rewards team rotates a support phone for any serious problems.  Usually it's an Oracle Split-Brain, though we have that under some control.  Today it was a little different.  I received a call from one of our business clients asking for help in looking up a customer's information and needed some help.  Didn't seem a Level 3 support, urgent matter, but whatever.  Turns out there is a deceased individual somewhere in a bordering state and all he had on him was our Speedy Rewards card.  The police had contacted our office for help.

Just another reason never to leave home without your card.

with no comments
Filed under: