我有同样的问题,在 hibernate 3 here 中得到了回答。但是,我无法将其应用于 hibernate 4,因为没有 @CollectionOfElements 注释。有人可以提供可以使用 hibernate 4 执行的解决方案吗?
编辑:将 @CollectionOfElements 更改为 @ElementCollection 对我有用。我现在应该如何处理@JoinTable,因为那里没有表字段。
最佳答案
Hibernate 4仅支持标准的JPA注释,即@ElementCollection .
请注意,甚至 Hibernate 3 recommends using this standard annotation :
Deprecated. use @ElementCollection
关于java - Hibernate 4 - 可以向 @ManyToMany Hibernate 额外表添加额外字段吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13770675/