There's a way to convert this SQL statement to a NHibernate Criteria?
(select b1.FieldA as Name, b1.FieldA as FullName from Sale b1 where b1.FieldA like '%john%' or b1.FieldA like '%john%' order by b1.Id desc)
union
(select b2.FieldC as Name, b2.FieldD as FullName from Sale b2 where b2.FieldC like '%john%' or b2.FieldD like '%john%' order by b2.Id desc)
union
(select c.FieldE as Name, c.FieldF as FullName from Client c where c.FieldE like '%john%' or c.FieldF like '%john%' order by c.Id desc)
I've found that NHibernate doesn't support Unions.
So, I've found two solutions. I perform each query separately than I concat the results. It's like a Union, but isn't performed in the DB, it's performed in memory.
OR
Try using a view. It can be mapped directly in NHibernate and does not rely on a specific database implementation. You should remove the where clauses, and then you can build your NHibernate criteria against "Name" and "FullName".