开发者

Can NHibernate produce SQL that is not commented with param names?

Is it possible to configure NHibernate to not show the parameter names in comments, in the SQL it produces?

E.g.

WHERE  s开发者_如何学编程hareclass1_.PeerGroupId in (1 /* @p0 */,8 /* @p1 */,7 /* @p2 */,10 /* @p3 */,
                                   20 /* @p4 */,2 /* @p5 */)

It makes the SQL very unreadable.


Try setting "use_sql_comments" to false. Using Fluent NHibernate's configuration:

var factory = Fluently.Configure()
                .Database(configurer)
                .Mappings(m =>  /* etc */)
                .ExposeConfiguration(configuration =>
                                     configuration
                                         .SetProperty(Environment.UseSqlComments, "false"))
                .BuildSessionFactory();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜