I am using the latest NH build.
When I try to execute the following query:
Session.Query<UserActivation>().SingleOrDefault(ua =>
ua.ActivationCode == code);
(code and UserActivation.ActivationCode are both byte[] and
ActivationCode is persisted to the SQL DB as a varbinary)
I get the following exception:
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException was unhandled by user
code
Message=Exception of type
'Antlr.Runtime.MismatchedTreeNodeException' was thrown.
[.SingleOrDefault[Model.Entities.UserActivation]
(NHibernate.Linq.NhQueryable`1[Model.Entities.UserActivation],
Quote((u, ) => (Equal(u.ActivationCode, System.Byte[]))), ) ] [snip]
I take it this means it's not currently possible to compare byte
arrays using the nhibernate linq provider, however the following works
just fine:
Session.CreateCriteria<UserActivation>().Add(Restrictions.Eq("ActivationCode",
code)).UniqueResult();
Is there any way to get this working with the linq provider? If not,
should I submit this as a bug in the issue tracker?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.