您如何告诉 Hibernate 您的实体类映射采用 JPA 1.0 语法?

发布于 2024-09-30 13:55:10 字数 329 浏览 0 评论 0原文

的后续内容

这是 JPA 1.0 使用带有 *nested* 复合主键的 @IdClass 的限制?

EclipseLink 附带了一个 javax.persistence_1.0.0.jar,我也将其放入类路径中,因此它可以了解我的实体类的版本。但是 Hibernate 如何知道 JPA 1.0 中应该包含实体类呢?能做到吗?如果是这样,怎么办?

This is a follow-up to

Limitation of JPA 1.0 using @IdClass with *nested* composite primary keys?

EclipseLink comes with a javax.persistence_1.0.0.jar which I also put onto the classpath, so it can know about the version of my entity classes. But how does Hibernate know the entity classes are meant to be in JPA 1.0? Can it be done? If so, how?

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

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

发布评论

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

评论(1

北城半夏 2024-10-07 13:55:10

但是 Hibernate 如何知道实体类应该在 JPA 1.0 中?

如果可以做到这一点,我会押注于 persistence.xml 的版本。但我真的不确定这是否真的限制了 JPA 2.0 功能的使用。

如果您想确保不使用 JPA 2.0 中的任何内容(即 Hibernate EntityManager 3.4),为什么不使用 JPA 1.0 实现呢?有什么事情阻止你这样做吗?

But how does Hibernate know the entity classes are meant to be in JPA 1.0?

If this can be done, I would bet on the version of the persistence.xml. But I'm really not sure this actually restricts the use of JPA 2.0 features.

Why not using a JPA 1.0 implementation if you want to be sure that you're not using anything from JPA 2.0 (i.e Hibernate EntityManager 3.4 in the case of Hibernate)? Is there anything that prevent you from doing so?

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