Hi All,

I have a couple of entities setup like this:

Foo <-->> FooItem

The "items" to-many has owns destination checked and a delete rule of cascade.  
Then the "foo" to-one in the FooItem entity that points back to the parent is 
set to nullify.

Why then when I do this:

        aFoo.delete();
        ec.saveChanges();

I get a a validation exception like this:

ERXValidationException: A <b>Foo Item</b> must have a <b>Foo</b>.
  at 
com.webobjects.eoaccess.EORelationship.validateValue(EORelationship.java:1860)
  at 
com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKey(EOEntityClassDescription.java:456)
  at 
er.extensions.eof.ERXEntityClassDescription.validateValueForKey(ERXEntityClassDescription.java:814)
  at 
com.webobjects.eocontrol.EOCustomObject.validateValueForKey(EOCustomObject.java:1311)
  at 
er.extensions.eof.ERXGenericRecord.validateValueForKey(ERXGenericRecord.java:1248)
  at 
com.webobjects.eocontrol.EOCustomObject.validateForSave(EOCustomObject.java:1381)
  at 
er.extensions.eof.ERXGenericRecord.validateForSave(ERXGenericRecord.java:1299)
  at 
com.webobjects.eocontrol.EOCustomObject.validateForUpdate(EOCustomObject.java:1446)
  at 
er.extensions.eof.ERXGenericRecord.validateForUpdate(ERXGenericRecord.java:1338)
  at 
com.webobjects.eocontrol.EOEditingContext.validateTable(EOEditingContext.java:2271)
  at 
com.webobjects.eocontrol.EOEditingContext.validateChangesForSave(EOEditingContext.java:3020)
  at 
com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges(EOEditingContext.java:3249)
  at 
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3179)
  at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1085)
  at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1007)
  at com.mpv.webcomponents.MPVWOComponent.saveChanges(MPVWOComponent.java:233)
  at 
com.mpv.reportcomponents.ReportPublishDelete.delete(ReportPublishDelete.java:80)
  ... skipped 83 stack elements

these are some objects I converted recently to use the eo gap generation 
pattern.  I'm looking through my code and I can't yet find anything that would 
cause this.  The entities seem to be setup right.  But things are just not 
behaving as expected.

Any ideas where to look?


Thanks
Ricardo


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to