I have an entity with an ElementCollection
{code:java} @Entity @Table(name = "TEST_EC_PERSON") public class Person { @Id @GeneratedValue private long id;
@Version private long version;
@Column(name = "NAME", length = 100) private String name;
@ElementCollection(fetch = FetchType.EAGER) @CollectionTable(name = "TEST_EC_ADDRESS", joinColumns=@JoinColumn(name="person_id")) private Set<Address> addresses = new HashSet<Address>(); {code}
When I read the entity within a Transaction the members of the ElementCollection are deleted and reinserted on commit. This increments the version of the entity. I do not change Entity and Embeddables.
When I read the entity without Transaction the version is not incremented. |
|