[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] Clarification of @ManyToOne(optional = false) semantics
|
Hi all.
In my @ManyToOne-mappings where the association is required, and I have a not-null constraint in the DB, I add the "optional = false" attribute. This however doesn't seem to be enough in EL and I get many "not null constraint violated"-errors in my app (ported from Hibernate). The remedy is to have "nullable = false" on the @JoinColumn-annotation.
I thought "nullable=false" on @JoinColumn was just a hint the to DDL-generation phase (whcih I'm not using, as I'm managing the db-schema using hand-written SQL-scripts) and had no practical meaning, but it certainly appears to be necessary to avoid not-null violations.
I'm wondering if this is according to spec, and is this how EL is supposed to work?
Thansk for any clarification.
--
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