LAZY fetch association (list) updated when the owning entity is merged in EAP 6
Issue
- An association is declared between
MemberandAddressusingFetchType.LAZY
public class Member implements Serializable {
@Id
@GeneratedValue
private Long id;
...
@ManyToMany(fetch=FetchType.LAZY, targetEntity=Address.class)
@JoinTable(name="tbl_member_address",
joinColumns = @JoinColumn(name="member_id"),
inverseJoinColumns = @JoinColumn(name="address_id")
)
private List<Address> addresses = new ArrayList<Address>();
- An instance of
Memberis instantiated using the ID of an existing entity - After modifying various properties (not including the association property), the new instance is merged using the
EntityManager - The association between the
MemberandAddressentities is severed (the association rows are deleted from thetbl_member_addresstable)
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.