Parameterized Queries in HQL

NHibernate supports parameterized queries but unless you go looking in the Java documentation it’s not obvious how to do it.  Turns out it’s really simple:

IList results = _session.Find("from MyAssembly.MyClass as MyClass where MyClass.Foo = ?",
   
tagText, TypeFactory.GetStringType(64));

You can pass in arrays of objects and types for the last two parameters if you have more than one parameter in your HQL.