开发者

Nhibernate - How to get rid of unwanted text cast

开发者 https://www.devze.com 2022-12-31 06:23 出处:网络
I am us开发者_如何学Pythoning Nhibernate 2 and PostgreSql The above code generate a query with a cast on expression

I am us开发者_如何学Pythoning Nhibernate 2 and PostgreSql

The above code generate a query with a cast on expression

res = _session.CreateCriteria(typeof(C))
                    .Add(Restrictions.Eq("Exp", Exp))
                    .AddOrder(new Order("Fr", false))
                    .SetMaxResults(MW)
                    .List<C>();

Exp is a character varying(30)

The generated query looks like: SELECT ... FROM table WHERE Exp = 'text':: text ...

I want to get rid of cast 'text":: text because the index is not used.

Nicolas


That doesn't make sense. The cast shouldn't matter. Is this a UTF-8 database?

0

精彩评论

暂无评论...
验证码 换一张
取 消