[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] not-null violation persisting unidirectional @OneToMany with @JoinColumn(nullable=false)
|
Hi.
I'm having this mapping:
@OneToMany(fetch = FetchType.LAZY, cascade = Array(CascadeType.ALL), orphanRemoval = true)
@JoinColumn(name = "owner_id", nullable = false)
private List<Car> carList;
According to this
http://stackoverflow.com/a/12763199 EL will update the owner_id in a separate statement, triggering the not-null violation unless one has defferred not-null constraints.
This really is counter-intuitive having nullable=false on the @JoinColumn, clarely indicating that EL should insert the value as part of the INSERT-statement for the entity defining the @OneToMany association.
Is there a way to get around this, keeping the association unidirectional and not having to make the not-null constraint defferable?
Shall I file a bug?
Thanks.
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx> mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc