In one to many JPA associations is it considered a best practice to initialize relationships to empty collections? For example.
@Entity
public class Order {
@Id
private Integer id;
// should the line items be initialized with an empty array list or not?
@OneToMany(mappedBy="order")
List<LineItem> lineItems = new ArrayList<>();
}
In the above example is it better to define lineItems with a default value of an empty ArrayList or not? What are the pros and cons?