Hibernate Many to Many Relations Set Or List?

后端 未结 3 1455
失恋的感觉
失恋的感觉 2020-12-22 20:52

I have a many to many relationship at my Java beans. When I use List to define my variables as like:

@Entity
@Table(name=\"ScD\")
public class G         


        
3条回答
  •  清歌不尽
    2020-12-22 21:16

    How about the uniqueness requirement from Set? Doesn't this force Hibernate to retrieve all objects each time one is added to the collection to make sure a newly added one is unique? A List wouldn't have this limitation.

提交回复
热议问题