| If you have the following entity:
@Entity(name = "SomeEntity")
@IdClass(SomeEntityPK.class)
public static class SomeEntity {
@Id
private long id;
@Id
@ManyToOne
private ReferencedEntity referencedEntity;
}
And the SomeEntityPK looks like this:
public static class SomeEntityPK implements Serializable {
private Long id;
private Long referencedEntity;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getReferencedEntity() {
return referencedEntity;
}
public void setReferencedEntity(Long referencedEntity) {
this.referencedEntity = referencedEntity;
}
}
If we run the following test case:
ReferencedEntity referencedEntity = new ReferencedEntity();
referencedEntity.setId( 42L );
SomeEntity someEntity = new SomeEntity();
someEntity.setId( 23L );
someEntity.setReferencedEntity( referencedEntity );
entityManager.merge( someEntity );
assertTrue( entityManager.contains( referencedEntity ) );
We now get an EntityNotfoundException. However, this test runs fine on 5.2.12, so something has changed between 5.2.12 and 5.3.0.Beta1. |