You can pass references to objects with ObjectDataSource. Add an eventhandler to ObjectDataSource.Selecting, and pass the reference there.
For example:
Code:
protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["paramName"] = someObject;
}
Both Select and SelectCount will trigger this event.
About HQL. IMHO, you shouldnt use HQL to do this select. Check out the ICriteria API, which is much easier to work with when you are dealing with multiple search criterias. Building strings is just bad. :)