Hibernate 休眠集合或列表

Hibernate 休眠集合或列表,hibernate,list,set,Hibernate,List,Set,有人知道什么时候在hibernate映射文件中使用Set和List吗 <set name="" table=""> <key> <column name="" /> </key> </set> <list name="" cascade="all"> <key column="" /> <index column="" /> <one-

有人知道什么时候在hibernate映射文件中使用Set和List吗

<set name="" table="">
    <key>
        <column name="" />
    </key>
</set>


<list name="" cascade="all">
    <key column="" />
    <index column="" />
    <one-to-many class=""/>
</list>


谢谢。

看看这篇文章:

主要区别在于列表有顺序,而集合没有。此外,集合不能有重复的值,而列表可以

  • 我们不能在集合中指定重复的值,但可以在列表中指定
  • 插入顺序未保留在集合中,但保留在列表中
  • 可能重复的