[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] Synchronization error when insertable = false in EclipseLink
|
Hi all,
Could anyone help to solve the following problem. This is the entity
@Entity
public class Order {
...
@OneToMany (fetch = FetchType.LAZY)
@JoinColumn(name="order_uuid", insertable = false, updatable = false)
private List<Item> items;
}
When new Oder is created and saved it in DB this error is thrown:
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.
We also tried this variant:
@OneToMany (fetch = FetchType.LAZY, cascade = CascadeType.DETACH)
@JoinColumn(name="order_uuid", insertable = false, updatable = false)
@Mutable(false)
private List<Item> items;
but result was the same.
How explain the reason of this error (insertable = false) and how to fix it (We don't want to create new items when we create order)?
Best regards, Alex Sviridov