I have schema, with such mapping.
Next code don't work:
IList<User> userList = session.CreateCriteria<User>()
.Add(Restrictions.Eq("Login", login))
.List<User>();
Exception: System.InvalidCastException: Specified cast is not valid
Full stacktrace: link