Hello -
I have a simple bit of code to save an EO:
EOEditingContext ec = new EOEditingContext(); ((Session)session()).lockManager.registerEditingContext(ec); TemplateReport report = new TemplateReport(); ec.insertObject(report); report.setPortfolio((Portfolio)EOUtilities.localInstanceOfObject(ec,((Session)session()).portfolio())); report.setAuthor(reportAuthor); report.setTitle(reportTitle); report.setTextDescription(reportDescription); report.setAddDate(new NSTimestamp()); report.setLastModDate(new NSTimestamp()); report.setEntityName(((Session)session()).entityName); report.setQueryBindings(((CustomMutableDictionary)((Session)session()).reportQueryDict).archiveData()); report.setColumnKeys(((CustomMutableArray)((Session)session()).theReportKeys()).archiveData()); report.setLeftPickKeys(((CustomMutableArray)((Session)session()).theLeftList()).archiveData()); report.setRightPickKeys(((CustomMutableArray)((Session)session()).theRightList()).archiveData()); ec.saveChanges(); ((Session)session()).lockManager.unregisterEditingContext(ec);
However it is giving me the following error... basically asking to update an attribute that doesn't exist here but in the Project EO which I am not using at this point:
I have not idea where it is finding "actualCostToDate" key.
any thoughts?
[2006-01-24 09:23:39 CST] <WorkerThread8> com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: <com.tos.eo.TemplateReport 0x57256f> valueForKey(): lookup of unknown key: 'actualCostToDate'. This class does not have an instance variable of the name actualCostToDate or _actualCostToDate, nor a method of the name actualCostToDate, _actualCostToDate, getActualCostToDate, or _getActualCostToDate at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.handleQueryWithUnboundKey(NSKeyValueCoding.java:1316) at com.webobjects.eocontrol.EOCustomObject.handleQueryWithUnboundKey(EOCustomObject.java:1623) at com.webobjects.foundation.NSKeyValueCoding$Utility.handleQueryWithUnboundKey(NSKeyValueCoding.java:544) at com.webobjects.foundation.NSKeyValueCoding$_KeyBinding.valueInObject(NSKeyValueCoding.java:920) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1736) at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject(EODatabaseContext.java:4996) at com.webobjects.eoaccess.EODatabaseContext.recordInsertForObject(EODatabaseContext.java:4901) at com.webobjects.eoaccess.EODatabaseContext.prepareForSaveWithCoordinator(EODatabaseContext.java:5849) at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:409) at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3165) at com.tos.reports.ReportSaveConfig.save(ReportSaveConfig.java:56) 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:324) at com.webobjects.foundation.NSKeyValueCoding$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.valueInComponent(WOKeyValueAssociation.java:46) at com.webobjects.appserver._private.WOSubmitButton.invokeAction(WOSubmitButton.java:59) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110) at com.webobjects.appserver._private.WOForm.invokeAction(WOForm.java:82) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(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.WOSwitchComponent.invokeAction(WOSwitchComponent.java:171) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(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:1166) at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1375) at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:196) at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:287) at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322) at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358) at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432) at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1306) 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)
|