EO model validation, relations and foreign keys

Zak Burke <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
When I validate a model using the woproject Entity Modeler, it complains
if a class has a relationship with the Optionality is marked "Mandatory"
but the join-field marked as optional. If I make both the relationship
and the foreign-key required, however, EOF complains in
EOEditingContext.saveChanges() that the foreign key can't be null:

	Validation failed on an object [org.thei3p.eo.DLOrganization]
	with keypath = entityId and exception: The entityId property of
	DLOrganization is not allowed to be null.

It seems to me that the Entity Modeler gets the constraints right but
that EOF is doing validation before it generates keys for the DB tables.

Is there any way to force EOF to generate its EO keys before checking
the validity of the EOs to be persisted? (I realise I could post this to
the woproject list and ask the same question from a different point of
view, i.e. should required relations without required foreign keys
really be a validation error?, but I think Entity Modeler is doing the
right thing here.)

Thanks,

zak.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.