NH-2401

Implementation and simple unit test
https://nhibernate.jira.com/browse/NH-2401
@oskarb @hazzik: Debugging the code, it is clear that the parameter type is being correctly set, but I'm not sure how to do it in a unit test, have you got any suggestions?
@rjperes do we still need these pieces?