This my entity
@Entity
public class Order {
...
@OneToMany (fetch = FetchType.LAZY)
@JoinColumn(name="order_uuid", insertable = false, updatable = false)
private List<Item> items;
}
When I create new Oder
and save it in DB I get:
Caused by: java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: com.temp.Item@3cd8c5f.
Could anyone explain the reason of this error (I did add insertable = false
) and how to fix it (I don't want to create new items when I create order)?