I hava a entity
class Entity1{
@OneToOne(fetch = FetchType.LAZY,cascade = {REMOVE,MERGE})
@ToString.Exclude
private Entity2 entity2;
}
class Entity2{
private String name;
}
And when call entity1.getEntity2().setName(“xxx”) and repository.flush() or repository.merge(entity1)
The error is
Could not locate field name [id] on class [org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer$1]