Workaround for NHibernate DB2 inexact query bug?
Do开发者_如何学Ces anyone know a workaround for NH-2436?
Basically, when you concatenate a parameter in the case of (% || ? || %)
DB2 requires it to be cast as in CAST((% || ? || %) AS VARCHAR(255))
which NHibernate does not do, otherwise an exception is thrown.
Is there some way to work around this and do a parameter based LIKE
query using NHibernate against DB2?
Well, if you throw fluentNhibernate, Linq, and automapping out the window I was able to work around this with a named query.
精彩评论