0

我有同样的问题,这里在 hibernate 3 中得到了回答。但是,我不能将此应用于休眠 4,因为没有 @CollectionOfElements 注释。有人可以提供可以使用hibernate 4执行的解决方案吗?

编辑:将@CollectionOfElements 更改为@ElementCollection 对我有用。我现在应该用@JoinTable 做什么,因为那里没有表格字段。

4

1 回答 1

1

Hibernate 4 仅支持标准 JPA 注释,即@ElementCollection

请注意,即使Hibernate 3 也建议使用此标准注释

已弃用。使用@ElementCollection

于 2012-12-07T21:00:35.917 回答