I have a uniqueidentifier field as an identifier on a SQL Server
table.  This field is mapped using code gen to a Guid property using
NHibernate.  My problem is this:  My users want to do a "Like" search
on this field.  The problem is that "%5%" is not a Guid, it's a string
and can't be converted to a Guid.  When this gets passed through to
NHibernate it blows up since the datatype is wrong.  Short of writing
my own SQL to get the data, is there any way to accomplish this?  Part
of the issue is that this is part of a custom query builder, so I
don't know in advance which fields will be searched on, how they'll be
combined (AND, OR, etc.) and what type of search they might be doing
(equals, contains, null, etc.).

I'm pretty new to NHibernate, so I'm hoping that there's an easy way
to do this that I don't know of.  Changing the code gen is probably
not acceptable, so I need to find some other way to do this.

Dave

-- 
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.

Reply via email to