• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A relationship in a converted model now throws an exception on save
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A relationship in a converted model now throws an exception on save


  • Subject: Re: A relationship in a converted model now throws an exception on save
  • From: David Holt <email@hidden>
  • Date: Wed, 14 Jan 2009 11:32:19 -0800

Hi guys,

On 14-Jan-09, at 9:47 AM, Chuck Hill wrote:

Hi Mai,


On Jan 13, 2009, at 7:34 PM, MAI NGUYEN wrote:

Hello Chuck:
Mark the id attribute as Allows Null and then make the relationship optional.
If the attribute is a primary key attribute and of a numeric type (ex. integer type), then you cannot set it to allow null.
I got the same error as David.


Mike is working on a fix in Entity Modeler, I believe.

Perhaps I don't understand how you are modeling this. A PK to PK relationship can't be optional. A PK to FK relationship can be optional, but is a properly a to-many relationship.

I messed up in various ways in looking at this problem. The first was that it was one of my very first models using EOModeler, so I had the relationship running backwards. How this worked correctly in the past, I really don't know. The second way that I messed up was that my Eclipse build was picking up changes in the /Library/Frameworks directory, not in my project. This led to me trying all sorts of modeling behaviour in the framework project I was linked to that wasn't showing up when I ran it. When I finally discovered that this was happening...



How are you modeling this?

... I had already deleted the relationship entirely.

David



Chuck


On Jan 13, 2009, at 6:57 PM, Chuck Hill wrote:


On Jan 6, 2009, at 3:31 PM, David Holt wrote:

An application that I have converted from XCode to Eclipse is throwing an error when I save a new document EO. I went back in and looked at the old version of the model in the XCode app and the relationship is marked as to-one optional. The entity modeler version is mandatory to-one and if I try to set it back to optional, it gives me a warning: "The relationship documentContent is optional but the attribute id does not allow nulls". What do I need to do to model this correctly and/or get rid of the error on save?

Mark the id attribute as Allows Null and then make the relationship optional.



Chuck



David



Jan 06 08:54:33 CARRFS_P2P[49429] (ERXNSLogLog4jBridge.java:43) WARN NSLog - <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
<er.extensions.validation.ERXValidationException object: <ca.cscw.carrfs_p2pmodel.Document pk:"null">; propertyKey: documentContent; type: MandatoryToOneRelationshipException; additionalExceptions: ()>
[2009-01-06 08:54:33 PST] <WorkerThread1> <er.extensions.validation.ERXValidationException object: <ca.cscw.carrfs_p2pmodel.Document pk:"null">; propertyKey: documentContent; type: MandatoryToOneRelationshipException; additionalExceptions: ()>
at com.webobjects.eoaccess.EORelationship.validateValue (EORelationship.java:1805)
at com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKe y(EOEntityClassDescription.java:443)
at er.extensions.eof.ERXEntityClassDescription.validateValueForKey (ERXEntityClassDescription.java:807)
at com.webobjects.eocontrol.EOCustomObject.validateValueForKey (EOCustomObject.java:1339)
at er.extensions.eof.ERXGenericRecord.validateValueForKey (ERXGenericRecord.java:1079)
at com.webobjects.eocontrol.EOCustomObject.validateForSave (EOCustomObject.java:1411)
at er.extensions.eof.ERXGenericRecord.validateForSave (ERXGenericRecord.java:1125)
at com.webobjects.eocontrol.EOCustomObject.validateForInsert (EOCustomObject.java:1473)
at er.extensions.eof.ERXGenericRecord.validateForInsert (ERXGenericRecord.java:1148)
at com.webobjects.eocontrol.EOEditingContext.validateTable (EOEditingContext.java:2249)
at com.webobjects.eocontrol.EOEditingContext.validateChangesForSave (EOEditingContext.java:3029)
at com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges (EOEditingContext.java:3283)
at com.webobjects.eocontrol.EOEditingContext.saveChanges (EOEditingContext.java:3213)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:981)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903)
at ca.cscw.carrfs_p2p.AttachMeetingDocument.toAttachMeetingDocument (AttachMeetingDocument.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor $1.methodValue(NSKeyValueCoding.java:684)
at com.webobjects.foundation.NSKeyValueCoding $_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
at com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268)
at com.webobjects.appserver.WOComponent.valueForKey (WOComponent.java:1539)
at com.webobjects.foundation.NSKeyValueCoding $Utility.valueForKey(NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath (NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath (WOComponent.java:1600)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComp onent(WOKeyValueAssociation.java:46)
at com.webobjects.appserver.WOComponent.valueForBinding (WOComponent.java:735)
at com.uploadsuite.NBUploadWithProgress.finalAction (NBUploadWithProgress.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor $1.methodValue(NSKeyValueCoding.java:684)
at com.webobjects.foundation.NSKeyValueCoding $_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
at com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268)
at com.webobjects.appserver.WOComponent.valueForKey (WOComponent.java:1539)
at com.webobjects.foundation.NSKeyValueCoding $Utility.valueForKey(NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath (NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath (WOComponent.java:1600)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComp onent(WOKeyValueAssociation.java:46)
at com.webobjects.appserver._private.WOGenericElement.invokeAction (WOGenericElement.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at er.extensions.components._private.ERXWOForm.invokeAction (ERXWOForm.java:180)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction (WOComponent.java:945)
at com.webobjects.appserver._private.WOComponentReference.invokeAction (WOComponentReference.java:104)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at com.webobjects.appserver._private.WOComponentContent.invokeAction (WOComponentContent.java:31)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at com.webobjects.appserver._private.WOComponentContent.invokeAction (WOComponentContent.java:31)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at er.extensions.components.conditionals.ERXWOConditional.invokeChildr enAction(ERXWOConditional.java:111)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at er.extensions.components.conditionals.ERXWOConditional.invokeAction (ERXWOConditional.java:102)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction (WOComponent.java:945)
at com.webobjects.appserver._private.WOComponentReference.invokeAction (WOComponentReference.java:104)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction (WOComponent.java:945)
at com.webobjects.appserver._private.WOComponentReference.invokeAction (WOComponentReference.java:104)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenActi on(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction (WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction (WOComponent.java:945)
at com.webobjects.appserver.WOSession.invokeAction (WOSession.java:1168)
at com.webobjects.appserver.WOApplication.invokeAction (WOApplication.java:1375)
at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction (ERXAjaxApplication.java:49)
at er.extensions.appserver.ERXApplication.invokeAction (ERXApplication.java:1539)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispat chWithPreparedPage(WOComponentRequestHandler.java:196)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispat chWithPreparedSession(WOComponentRequestHandler.java:287)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispat chWithPreparedApplication(WOComponentRequestHandler.java:322)
at com.webobjects.appserver._private.WOComponentRequestHandler._handle Request(WOComponentRequestHandler.java:358)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleR equest(WOComponentRequestHandler.java:432)
at com.webobjects.appserver.WOApplication.dispatchRequest (WOApplication.java:1306)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately (ERXApplication.java:1654)
at er.extensions.appserver.ERXApplication.dispatchRequest (ERXApplication.java:1619)
at com.uploadsuite.NBUploadAction.finalResponse (NBUploadAction.java:355)
at com.uploadsuite.NBUploadAction.performAction (NBUploadAction.java:116)
at com.uploadsuite.NBURequestHandler.handleRequest (NBURequestHandler.java:47)
at com.webobjects.appserver.WOApplication.dispatchRequest (WOApplication.java:1306)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately (ERXApplication.java:1654)
at er.extensions.appserver.ERXApplication.dispatchRequest (ERXApplication.java:1619)
at com.webobjects.appserver._private.WOWorkerThread.runOnce (WOWorkerThread.java:173)
at com.webobjects.appserver._private.WOWorkerThread.run (WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden



-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects








_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >A relationship in a converted model now throws an exception on save (From: David Holt <email@hidden>)
 >Re: A relationship in a converted model now throws an exception on save (From: Chuck Hill <email@hidden>)
 >Re: A relationship in a converted model now throws an exception on save (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: OpenBase & WebObjects for scaling
  • Next by Date: Re: Bug ID 6342679: NSTimestamp Happy New Year Bug
  • Previous by thread: Re: A relationship in a converted model now throws an exception on save
  • Next by thread: Re: [ANN] WOGWT framework for integrating GWT with WebObjects
  • Index(es):
    • Date
    • Thread