Hibernate中是否有与“collection-type”等效的注释?

4
在Hibernate中,您可以通过在Hibernate XML映射文件中设置“collection-type”属性来定义自定义集合类型。
我想知道是否有注释等效项。
PS:我尝试使用@Type,但Hibernate抱怨:
"Illegal attempt to map a non collection as a @OneToMany, @ManyToMany" ...

所以我认为@Type仅适用于常规属性。
谢谢!

你的意思是,你有自己的集合类型,而不是像java.util.List那样实现Collections接口之一? - Alexander Rühl
@Geziefer,实际上我曾尝试使用Glazed Lists的“EventList”(http://www.glazedlists.com/documentation/hibernate#TOC-Hibernate-mapping-for-EventLists)而不是List。但我早就放弃了这个想法:有太多的“副作用”。 - Bogdan
哎呀,没注意到你的问题是半年前的了。虽然我没听说过这个,但我有一种感觉,在 O/R 映射中使用标准结构总是值得的。 - Alexander Rühl
1个回答

3

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接