[英]Hibernate tools Pojo Generation uses Set by default
Hibernate tools Pojo Generation uses java.util.Set by default. 休眠工具Pojo Generation默认使用java.util.Set。 I want to generate POJO's with java.util.List instead of java.util.Set.
我想用java.util.List而不是java.util.Set生成POJO。 Is there any way ?
有什么办法吗?
If you're using HBM files, you can use <bag>
or <list>
instead of <set>
如果您正在使用HBM文件,则可以使用
<bag>
或<list>
代替<set>
Check Hibernate documentation at : http://docs.jboss.org/hibernate/core/3.5/reference/en/html/collections.html#collections-mapping 在以下位置查看Hibernate文档: http : //docs.jboss.org/hibernate/core/3.5/reference/en/html/collections.html#collections-mapping
Actually, Hibernate creates mapping on your database structure. 实际上,Hibernate在您的数据库结构上创建映射。 I have one to many mapping without index column so it generates 'Set' which is correct for non indexed one to many mapping.
我有没有索引列的一对多映射,因此它会生成“设置”,这对于未索引的一对多映射是正确的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.