Re: com.webobjects.eoaccess.EOGeneralAdaptorException: Object value '10348' for column 7 is not an instanceof String
Lenny Marks <[email protected]> Thu, 27 Mar 2003 17:59:05 -0500 (EST)
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <Pine.GSO.4.44.0303271754570.7974-100000@kirk> |
Thanks for the suggestion. I wasn't able to remove the relationship
completely because the EOModeler complains that the subclass doesn't
include a relationship defined in the parent entity ManCorr. Instead, I
removed the flattened relationship on OutManCorr and replaced it with a
direct relationship to Manuscript. This seems to have solved the problem.
-lenny
On Wed,
26 Mar 2003, David Neumann wrote:
> One thing that would be nice to rule out is the side-effects of using a
> flattened relationship. These usually don't make sense to use (except
> in many-to-manys) and can have negative side-effects. Plus you've got
> inheritance going on to boot further complicating things. I'd get rid
> of the flattened 'manuscript' relationship. And just access this guy
> using mancorr.manuscript. Then start debugging from there.
>
> d
>
>
> On Tuesday, March 25, 2003, at 10:37 PM, Lenny Marks wrote:
>
> >
> > In my eomodel, OutManCorr inherits the manuscriptId from ManCorr and
> > the
> > 'manuscript' relationship is flattened from the parent ManCorr.
> >
> > {
> > definition = "mancorr.manuscript";
> > internalInfo = {"_nameInObjectStore" = "mancorr_manuscript"; };
> > joinSemantic = EOInnerJoin;
> > name = manuscript;
> > }
> >
> > The snippet below is also from OutManCorr.plist
> >
> > -lenny
> >
> > On Tue, 25 Mar 2003, Chuck Hill wrote:
> >
> >> How is the 'manuscript' relationship from OutManCorr to the
> >> Manuscript entity
> >> defined?
> >>
> >>
> >>
> >> Lenny Marks wrote:
> >>
> >>> com.webobjects.eoaccess.EOGeneralAdaptorException: Object value
> >>> '10348'
> >>> for column 7 is not an instanceof String
> >>>
> >>> Ignoring the fact that my time is not set, does anyone know what
> >>> could be
> >>> the cause of this error.(full stack trace below) It occurs when I
> >>> run the
> >>> following code. The value '10348' is the manuscriptId.
> >>>
> >>> I have an entity OutManCorr(OutCorrespondence) which is a subclass of
> >>> ManCorr(Manuscript Correspondence). Single table mapping is used.
> >>> ManCorr has a non class property manuscriptId which is
> >>> used in the 'manuscript' relationship to the Manuscript entity.
> >>> {
> >>> columnName = "MANUSCRIPT_ID";
> >>> externalType = NUMBER;
> >>> name = manuscriptId;
> >>> valueClassName = NSNumber;
> >>> valueType = i;
> >>> },
> >>>
> >>> We are using EOGenerator to generate a subclass that presents the
> >>> public
> >>> interface and houses all business logic. (hence the
> >>> setMethod(ManCorr.Method.Email) method). I have already checked to
> >>> make
> >>> sure that all the external types in my eomodel match the database
> >>> schema.
> >>> All the value types and value classes are set correctly.
> >>>
> >>> WebObjects 5.2 with Oracle 8i
> >>>
> >>> Thanks,
> >>> Lenny Marks
> >>>
> >>> public TestSendCorr(WOContext context)
> >>> {
> >>> super(context);
> >>> EOEditingContext ec = session().defaultEditingContext();
> >>>
> >>> Manuscript manuscript = (Manuscript)
> >>> EOUtilities.objectMatchingKeyAndValue
> >>> (ec, "Manuscript", "accode", "LX8437");
> >>>
> >>> CorrCode corrCode = (CorrCode)
> >>> EOUtilities.objectMatchingKeyAndValue
> >>> (ec, "CorrCode", "code", "OK");
> >>>
> >>> OutManCorr outCorr = (OutManCorr)
> >>> EOUtilities.createAndInsertInstance(ec, "OutManCorr");
> >>>
> >>> //relationships
> >>> outCorr.setManuscript(manuscript);
> >>> outCorr.setCorrcode(corrCode);
> >>>
> >>> outCorr.setMethod(ManCorr.Method.EMAIL);
> >>> outCorr.setSentBy(((Session)session()).user());
> >>> outCorr.setSubject("test");
> >>>
> >>> ec.saveChanges();
> >>>
> >>> }
> >>>
> >>> #################################
> >>>
> >>>
> >>> [1970-01-14 01:21:16 EST] <WorkerThread0>
> >>> <com.webobjects.appserver._private.WOComponentRequestHandler>:
> >>> Exception
> >>> occurred while handling request:
> >>> com.webobjects.foundation.NSForwardException
> >>> [com.webobjects.eoaccess.EOGeneralAdaptorException] null
> >>> [1970-01-14 01:21:16 EST] <WorkerThread0>
> >>> com.webobjects.foundation.NSForwardException for
> >>> com.webobjects.eoaccess.EOGeneralAdaptorException: Object value
> >>> '10348'
> >>> for column 7 is not an instanceof String.
> >>> at
> >>> com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseConte
> >>> xtInformationAdded(EODatabaseContext.java:4656)
> >>> at
> >>> com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseCo
> >>> ntext.java:6319)
> >>> at
> >>> com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditin
> >>> gContext(EOObjectStoreCoordinator.java:411)
> >>> at
> >>> com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContex
> >>> t.java:3130)
> >>> at TestSendCorr.<init>(TestSendCorr.java:40)
> >>> at java.lang.reflect.Constructor.newInstance(Native Method)
> >>> at
> >>> com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities
> >>> .java:529)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentDefinition._componentIns
> >>> tanceInContext(WOComponentDefinition.java:462)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentDefinition.componentInst
> >>> anceInContext(WOComponentDefinition.java:572)
> >>> at
> >>> com.webobjects.appserver.WOApplication.pageWithName(WOApplication.jav
> >>> a:1889)
> >>> at
> >>> com.webobjects.appserver.WOComponent.pageWithName(WOComponent.java:12
> >>> 05)
> >>> at Main.toTestSendCorr(Main.java:94)
> >>> at java.lang.reflect.Method.invoke(Native Method)
> >>> at
> >>> KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAc
> >>> cessor.java:54)
> >>> at
> >>> com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObje
> >>> ct(NSKeyValueCoding.java:1160)
> >>> at
> >>> com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valu
> >>> eForKey(NSKeyValueCoding.java:1268)
> >>> at
> >>> com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:154
> >>> 4)
> >>> at
> >>> com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyV
> >>> alueCoding.java:498)
> >>> at
> >>> com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementa
> >>> tion.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
> >>> at
> >>> com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java
> >>> :1605)
> >>> at
> >>> com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompon
> >>> ent(WOKeyValueAssociation.java:46)
> >>> at
> >>> com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlin
> >>> k.java:76)
> >>> at
> >>> com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
> >>> (WODynamicGroup.java:101)
> >>> at
> >>> com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynam
> >>> icGroup.java:110)
> >>> at
> >>> com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:95
> >>> 0)
> >>> at
> >>> com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1136)
> >>> at
> >>> com.webobjects.appserver.WOApplication.invokeAction(WOApplication.jav
> >>> a:1313)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
> >>> WithPreparedPage(WOComponentRequestHandler.java:196)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
> >>> WithPreparedSession(WOComponentRequestHandler.java:287)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
> >>> WithPreparedApplication(WOComponentRequestHandler.java:322)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentRequestHandler._handleRe
> >>> quest(WOComponentRequestHandler.java:358)
> >>> at
> >>> com.webobjects.appserver._private.WOComponentRequestHandler.handleReq
> >>> uest(WOComponentRequestHandler.java:432)
> >>> at
> >>> com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.
> >>> java:1244)
> >>> at
> >>> com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThre
> >>> ad.java:167)
> >>> at
> >>> com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.j
> >>> ava:248)
> >>> at java.lang.Thread.run(Thread.java:491)
> >>>
> >>>
> >>> _______________________________________________
> >>> EOF mailing list
> >>> [email protected]
> >>> http://www.omnigroup.com/mailman/listinfo/eof
> >>>
> >>
> >>
> >> --
> >>
> >> Chuck Hill [email protected]
> >> Global Village Consulting Inc.
> >> http://www.global-village.net
> >>
> >>
> >>
> >> _______________________________________________
> >> EOF mailing list
> >> [email protected]
> >> http://www.omnigroup.com/mailman/listinfo/eof
> >>
> >
> > _______________________________________________
> > EOF mailing list
> > [email protected]
> > http://www.omnigroup.com/mailman/listinfo/eof
> >
>
>