如何关闭 Spring Roo 中的异常翻译?

发布于 2024-11-04 15:16:04 字数 260 浏览 3 评论 0原文

Roo 实体中的 JPA 代码将其异常自动转换为 Spring 数据异常。由于我正在移植纯 JPA 代码(将 DAO 代码移动到实体中,这似乎是 Roo 富域模型的标准),因此我宁愿不修改 Spring 专有异常的 catch 块。

有人可以告诉我如何在我的实体中关闭此功能吗? Spring JIRA 建议这是可能的,但我不知道如何实现。

JPA code in Roo's entities have their exceptions automatically translated to Spring data exceptions. As I am porting pure JPA code (moving DAO code into the entities as seems to be standard with Roo's rich domain model), I'd rather not modify the catch blocks for Spring's proprietary exceptions.

Can someone tell me how to turn this off in my entities? The Spring JIRA suggests this is possible, but I don't see how.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

汹涌人海 2024-11-11 15:16:06

删除应用程序上下文中的以下行不起作用?

<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />

我在 roo 源代码中没有发现任何此类 roo 功能的痕迹。

Removing the following line in your appcontext doesn't work?

<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />

I haven't found any traces in roo source to such roo functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文