开发者

customize error message for nhibernate

when deleting an entity in nhibernate i get an exception wi开发者_运维技巧th this error message:

delete statement conflicted with column reference constraint ..etc

of course the exception is wrapped in long series of exceptions.

the error message is normal, but can i make nhibernate shows more polite error message to the user ??

in another words:

is there any conventions which with, i can customize the exception ??

I'm using Oracle 11g data base.


Yes, you can implement ISQLExceptionConverter to customize the exceptions thrown by NHibernate.

Here's a complete example.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜