csharp 标准sql #NHibernate

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 标准sql #NHibernate相关的知识,希望对你有一定的参考价值。

query = @"not exists( select * from (select cp.Contractor , ccp.Contact , PhoneString from 
                ( select pp.id as Id , dbo.getCorrectPhone(pp.PhoneString) as PhoneString  from [{ELMA_DATA_BASE}].[dbo].Phone pp ) p 
                left join [{ELMA_DATA_BASE}].[dbo].Contractor_Phone cp on ( cp.Phone = p.Id )
                left join [{ELMA_DATA_BASE}].[dbo].Contact_Phone ccp on ( ccp.Phone = p.Id )
                where cp.Contractor is not null or ccp.Contact is not null)  as tt where tt.PhoneString = (CASE WHEN this_1_.DirectionMessage = 1 THEN " + " this_1_.\"From\" ELSE this_1_.\"To\" END ))";
                    query = query.Replace("{ELMA_DATA_BASE}", elmaBase);
                    criteria.Add(Expression.Sql(new SqlString(query)));
                    
                    
----------------------------------------------------------------------------------------


var rqPrimaryCauseAction = Expression.Sql(new SqlString("ltrim(rtrim(lower(tbp1_.PrimaryCauseAction))) not like '%' + REPLACE(ltrim(rtrim(lower(this_.Insight))),  ' ' , '%') + '%'"));

以上是关于csharp 标准sql #NHibernate的主要内容,如果未能解决你的问题,请参考以下文章

csharp 按sql #NHibernate分组

将此 SQL 查询转换为 NHibernate 标准查询

csharp: NHibernate and Entity Framework (EF) (object-relational mapper)

csharp SqlFunction #NHibernate

csharp NHibernate驱动程序Oracle

csharp:Nhibernate Procedure with CreateSQLQuery