I am trying to persist entities with @OneToMany and @ManyToOne relationships.
@OneToMany(mappedBy="customer", cascade=CascadeType.ALL, fetch=FetchType.EAGER)
private Collection<Address> addresses = new LinkedHashSet<Address>();
@ManyToOne
@JoinColumn(name="customer_id", referencedColumnName="customer_id")
private Customer customer;
problem is that it inserts NULL instead of customer_id in the address
table.
could you suggest why is that happening.
Thank you in advance.