I need to lookup a user by Alias, however I need this to be case
insensitive.  Basically I just need to know if the row exists or not.
Here's what I'm doing now:

return (User.FindFirst(new
NHibernate.Criterion.InsensitiveLikeExpression("Alias", alias)) !=
null);

However, I don't like this because it's not gonna use any indexes.
I've created an index on LOWER(Alias), thus I want the query generated
to be:

SELECT COUNT(*) FROM Users WHERE LOWER(Alias) = 'myvalue'; --This will
be very very fast.

Any ideas on how to generate this query with ActiveRecord?  Thanks!!

Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en.

Reply via email to