Introduction In this article, we are going to see why there is no benefit in using the Set collection type when mapping a bidirectional JPA OneToMany association. While the @OneToMany annotation can be used to map both unidirectional and bidirectional associations, as I explained this article, you should avoid the unidirectional mapping since it can lead to very inefficient SQL statements. Domain Model The goal of the bidirectional JPA OneToMany association is to map the one-to-many table relationship, which consists of two tables that form a parent-child relationship via a Foreign Key... Read More
The post Avoid using Set for bidirectional JPA OneToMany collections appeared first on Vlad Mihalcea.