Re: Relationship Question
Re: Relationship Question
- Subject: Re: Relationship Question
- From: Greg <email@hidden>
- Date: Tue, 4 Jan 2005 15:26:34 +1000
Hi Chuck,
I just tried No Action and it still gives the exception. Below is the
full console log. I then tried turning off the mandatory bit for the
relationship in ProPrice on ProPriceSchedule just to see and it gave a
not null constraint error which was to be expected since the id for the
foreign key was null. I then cleaned the project and deleted all
temporary xcode files but it still gives the exception. I have tried
cascade as the delete rule as well, but the same exception is thrown.
Greg
[2005-01-04 15:22:29 EST] <WorkerThread1>
<er.extensions.ERXValidationException object:
<au.com.shoebox.businesslogic.ProPrice pk:"3">; propertyKey:
priceSchedule; type: MandatoryToOneRelationshipException;
additionalExceptions: ()>
at
com.webobjects.eoaccess.EORelationship.validateValue(EORelationship.java
:1805)
at
com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKey(EOE
ntityClassDescription.java:443)
at
er.extensions.ERXEntityClassDescription.validateValueForKey(ERXEntityCla
ssDescription.java:712)
at
com.webobjects.eocontrol.EOCustomObject.validateValueForKey(EOCustomObje
ct.java:1339)
at
er.extensions.ERXGenericRecord.validateValueForKey(ERXGenericRecord.java
:804)
at
com.webobjects.eocontrol.EOCustomObject.validateForSave(EOCustomObject.j
ava:1411)
at
er.extensions.ERXGenericRecord.validateForSave(ERXGenericRecord.java:
843)
at
au.com.shoebox.businesslogic.ProPrice.validateForSave(ProPrice.java:42)
at
com.webobjects.eocontrol.EOCustomObject.validateForUpdate(EOCustomObject
.java:1490)
at
er.extensions.ERXGenericRecord.validateForUpdate(ERXGenericRecord.java:
882)
at
au.com.shoebox.businesslogic.ProPrice.validateForUpdate(ProPrice.java:
46)
at
com.webobjects.eocontrol.EOEditingContext.validateTable(EOEditingContext
.java:2191)
at
com.webobjects.eocontrol.EOEditingContext.validateChangesForSave(EOEditi
ngContext.java:2981)
at
com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges(EOEditi
ngContext.java:3222)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.j
ava:3152)
at er.extensions.ERXEC.saveChanges(ERXEC.java:467)
at
au.com.shoebox.professional.ProProductPricing.delete(ProProductPricing.j
ava:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.webobjects.foundation.NSKeyValueCoding$1.methodValue(NSKeyValueCodin
g.java:684)
at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(
NSKeyValueCoding.java:1160)
at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueFo
rKey(NSKeyValueCoding.java:1268)
at
com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1539)
at
com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValu
eCoding.java:498)
at
com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementatio
n.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at
com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:
1600)
at
com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent
(WOKeyValueAssociation.java:46)
at
com.webobjects.appserver._private.WOActiveImage.invokeAction(WOActiveIma
ge.java:255)
at
er.extensions.ERXPatcher$DynamicElementsPatches$ActiveImage.invokeAction
(ERXPatcher.java:268)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at er.extensions.ERXWORepetition.invokeAction(ERXWORepetition.java:230)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at
com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComp
onentContent.java:31)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction(WOCo
mponentReference.java:104)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
au.com.shoebox.woapplication.ShoeBoxComponent.invokeAction(ShoeBoxCompon
ent.java:47)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1166)
at
com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:
1375)
at er.extensions.ERXApplication.invokeAction(ERXApplication.java:594)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedPage(WOComponentRequestHandler.java:196)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedSession(WOComponentRequestHandler.java:287)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedApplication(WOComponentRequestHandler.java:322)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleReque
st(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleReques
t(WOComponentRequestHandler.java:432)
at com.webobjects.appserver.WOApplication.dispatchR2005-01-04
15:22:29,813 WARN ShoeBox[10425:50212 2] NSLog
(ERXNSLogLog4jBridge.java:41) -
<com.webobjects.appserver._private.WOComponentRequestHandler>:
Exception occurred while handling request:
<er.extensions.ERXValidationException object:
<au.com.shoebox.businesslogic.ProPrice pk:"3">; propertyKey:
priceSchedule; type: MandatoryToOneRelationshipException;
additionalExceptions: ()>
equest(WOApplication.java:1306)
at
er.extensions.ERXApplication.dispatchRequest(ERXApplication.java:638)
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:552)
2005-01-04 15:22:30,364 ERROR ShoeBox[10425:50212 2] ERXApplication
(ERXApplication.java:486) - Exception caught: A <b>Pro Price</b> must
have a <b>Price Schedule</b>.
Extra info: {CurrentPage =
"au.com.shoebox.professional.ProProductPricing"; uri =
"/cgi-bin/WebObjects/ShoeBox.woa/wo/RBGu9HMUAiAzRZVVavKPTg/
4.0.11.6.1.13?34,8"; CurrentComponent =
"au.com.shoebox.professional.ProProductPricing"; PreviousPageList =
("ShoeBox;RBGU9HM;au.com.shoebox.professional.ProMainMenu;
client=demo;",
"ShoeBox;RBGU9HM;au.com.shoebox.professional.ProPricingSchedules;
client=demo;",
"ShoeBox;RBGU9HM;au.com.shoebox.professional.ProProductPricing;
client=demo;"); }
<er.extensions.ERXValidationException object:
<au.com.shoebox.businesslogic.ProPrice pk:"3">; propertyKey:
priceSchedule; type: MandatoryToOneRelationshipException;
additionalExceptions: ()>
at
com.webobjects.eoaccess.EORelationship.validateValue(EORelationship.java
:1805)
at
com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKey(EOE
ntityClassDescription.java:443)
at
er.extensions.ERXEntityClassDescription.validateValueForKey(ERXEntityCla
ssDescription.java:712)
at
com.webobjects.eocontrol.EOCustomObject.validateValueForKey(EOCustomObje
ct.java:1339)
at
er.extensions.ERXGenericRecord.validateValueForKey(ERXGenericRecord.java
:804)
at
com.webobjects.eocontrol.EOCustomObject.validateForSave(EOCustomObject.j
ava:1411)
at
er.extensions.ERXGenericRecord.validateForSave(ERXGenericRecord.java:
843)
at
au.com.shoebox.businesslogic.ProPrice.validateForSave(ProPrice.java:42)
at
com.webobjects.eocontrol.EOCustomObject.validateForUpdate(EOCustomObject
.java:1490)
at
er.extensions.ERXGenericRecord.validateForUpdate(ERXGenericRecord.java:
882)
at
au.com.shoebox.businesslogic.ProPrice.validateForUpdate(ProPrice.java:
46)
at
com.webobjects.eocontrol.EOEditingContext.validateTable(EOEditingContext
.java:2191)
at
com.webobjects.eocontrol.EOEditingContext.validateChangesForSave(EOEditi
ngContext.java:2981)
at
com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges(EOEditi
ngContext.java:3222)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.j
ava:3152)
at er.extensions.ERXEC.saveChanges(ERXEC.java:467)
at
au.com.shoebox.professional.ProProductPricing.delete(ProProductPricing.j
ava:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.webobjects.foundation.NSKeyValueCoding$1.methodValue(NSKeyValueCodin
g.java:684)
at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(
NSKeyValueCoding.java:1160)
at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueFo
rKey(NSKeyValueCoding.java:1268)
at
com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1539)
at
com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValu
eCoding.java:498)
at
com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementatio
n.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at
com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:
1600)
at
com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent
(WOKeyValueAssociation.java:46)
at
com.webobjects.appserver._private.WOActiveImage.invokeAction(WOActiveIma
ge.java:255)
at
er.extensions.ERXPatcher$DynamicElementsPatches$ActiveImage.invokeAction
(ERXPatcher.java:268)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at er.extensions.ERXWORepetition.invokeAction(ERXWORepetition.java:230)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at
com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComp
onentContent.java:31)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction(WOCo
mponentReference.java:104)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO
DynamicGroup.java:101)
at
com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG
roup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:945)
at
au.com.shoebox.woapplication.ShoeBoxComponent.invokeAction(ShoeBoxCompon
ent.java:47)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1166)
at
com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:
1375)
at er.extensions.ERXApplication.invokeAction(ERXApplication.java:594)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedPage(WOComponentRequestHandler.java:196)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedSession(WOComponentRequestHandler.java:287)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedApplication(WOComponentRequestHandler.java:322)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleReque
st(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleReques
t(WOComponentRequestHandler.java:432)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.jav
a:1306)
at
er.extensions.ERXApplication.dispatchRequest(ERXApplication.java:638)
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:552)
On 04/01/2005, at 11:44 AM, Chuck Hill wrote:
Try No Action.
On Jan 3, 2005, at 3:44 PM, Greg wrote:
It is Nullify.
On 04/01/2005, at 5:31 AM, Chuck Hill wrote:
What is the delete rule on ProPrice to ProPriceSchedule?
On Jan 3, 2005, at 12:30 AM, Greg wrote:
Hi,
I have an entity called ProPriceSchedule that has a to-many
relationship to ProPrice. ProPriceSchedule owns the destination of
the relationship. When I try to delete the a price object by
removeObjectFromBothSidesOfRelationshipWithKey, an exception is
thrown and the description is "A <b>Pro Price</b> must have a
<b>Price Schedule</b>" I know that this is correct as the
relationship is mandatory in the ProPrice entity.
Why when I save the ec after removing the object that this is
happening?
Any help is greatly appreciated,
Regards,
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development 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