Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Regarding Bug #334899

I would like to start a discussion on the issue reported by bug #334899 as this is also an issue we're seeing with our own function tests.

The issue at hand is the optional attribute with the @ManyToOne and the @OneToOne relationships.  While the spec states that @Basic's optional attribute is both a hint and can be interpreted as a schema generation directive, the language used by the spec for the relationship annotations makes no such assertions.  It simply says "(Optional) Whether the association is optional. If set to false then a non-null relationship must always exist."

A simple test demonstrates that there is no runtime validation during flush/commit and the schema generation does not specify NOT NULL for the join column.

I intend to pursue a solution to this problem, but wanted to hear some feedback from the community on what the preferred solution would be: runtime validation or schema generation?

Back to the top