Re: Strange error message
Chuck Hill <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Organization | Global Village Consulting, Inc. |
| Message-ID | <[email protected]> |
What database are you using? EOF with Oracle or FrontBase usually uses a sequence generator on (in your example) RootClass to generate the PK for objects at or below that root. You should be able to do the same thing. Chuck Camille Troillard wrote: > Chuck, that's it! > > > Now I perfectly understand because my model used to work when I was > using unique PKs. > I guess I must rollback to the first implementation ... and find a way > to generate PK shorter than the default implementation. > > > Thanks to everybody that helped me to solve the problem!!! > > > Camille > > > > > On Tuesday, Oct 8, 2002, at 19:59 Europe/Paris, Chuck Hill wrote: > >> Ah Ha! I know the answer. EOs in an inheritance hierarchy MUST MUST >> MUST have unique primary keys. That is the only way that EOF can >> differentiate which class an object is. In your case >> >> RootClass ----> EntityA >> ----> EntityB >> >> No object of EntityA, EntityB (or RootClass if not abstract) can have >> the same PK. If EOF fetches an instance of EntityA with a PK of >> 1000, and then fetches an instance of EntityB with a PK of 1000 it >> will think (because the EOGlobalID is the same) that the EntityB >> instance is actually the EntityA instance. > > -- Chuck Hill [email protected] Global Village Consulting Inc. http://www.global-village.net