I have same question which was answered in hibernate 3 here . However, I can't apply this to hibernate 4 as there is no @CollectionOfElements annotation. Can someone provide the solution that can be executed using hibernate 4?
EDIT: changed @CollectionOfElements to @ElementCollection worked for me. What should I do with @JoinTable now, because there is no table field in there.
Hibernate 4 only supports the standard JPA annotation, which is @ElementCollection .
Note that even Hibernate 3 recommends using this standard annotation :
Deprecated. use @ElementCollection
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.